Analysis of Microgrid’s Operation Integrated to Renewable Energy and Electric Vehicles in view of Multiple Demand Response Programs

A suitable energy management scheme and integrating renewable energy resources (RERs) can significantly increase energy efficiency and the stability of future grids operation. This work modeled a household energy management comprising a microgrid (MG) system and demand response programs (DRPs). Residential loads with price-based tariffs are introduced to reduce peak load demands and energy costs. For incorporating the uncertainties in RERs, their stochastic nature is modeled with a probabilistic method. This paper proposes a joint optimization approach for the optimal planning and operation of grid-connected residential, rural MG integrated into renewable energy and electric vehicles (EVs) in view of DRPs. The investigation focuses on energy saving of residential homes under different DRPs and RERs integration. The EVs are integrated into MG by including photovoltaic (PV), wind turbine (WT), fuel cell (FC), and diesel engines (DEs). A multi-objective optimization problem has been formulated to minimize the operating cost, pollutant treatment cost, and carbon emissions cost defined as C1, C2, and C3, respectively. The load demand has been rescheduled because of three DRPs, i.e., critical peak pricing (CPP), real-time electricity pricing (RTEP), and time of use (TOU). Further, the EV load has also been analyzed in autonomous and coordinated charging strategies. Using a judgement matrix, the proposed multi-objective problem is transformed into a single-objective problem. The results of an artificial bee colony (ABC) algorithm are compared with the particle swarm optimization (PSO) algorithm. The simulation analysis was accomplished by employing ABC and PSO in MATLAB. The mathematical model of MG was implemented, and the effects of DRPs based MG were investigated under different numbers of EVs and load data to reduce different costs. To analyze the impact of DRPs, the residential, rural MG is implemented for 50 homes with a peak load of 5 kW each and EV load with 80 EVs and 700 EVs, respectively. The simulation results with different test cases are formulated while analyzing the tradeoff between ABC and PSO algorithms. The simulation analysis shows that multiple DRPs, EVs, and RERs offered a substantial trade-off.

Total capacity of m th DG PPV(t) Solar power generation at time t PWT(t) Wind power generation at time t PLd(t) Total load demand at time t PB(t) Battery charging power at time t PD(t) Battery discharging power at time t nm Actual number of m th DER nx Actual number of x th DER ΩBSS Total capacity of BSS

I. INTRODUCTION
A rapid increase in global energy demand requires further distributed energy generation with the existing fossil fuelsbased conventional generation. Fossil fuel-based generation leads to other acute challenges in terms of global warming and environmental pollution. However, microgrid (MG) based distributed and hybrid energy generation systems are less dependent on fossil fuels based power generations. MG can partially handle the environmental issues to fulfill the increasing load demand locally with different distributed generations (DGs). These DGs include solar photovoltaic (PV), wind turbines, fuel cells, micro-turbines, and diesel generators [1], [2]. MG modes for power generations play a prominent role in a smart grid (SG) environment. In general, there are two modes of MG, namely grid-tied and standalone. MG power generation is mostly dependent on intermittent-based renewable energy resources (RERs). The MG central control system effectively handles the uncertain nature of load demands and RERs power generation by managing and controlling all MG unit operations. Various benefits can be achieved with the help of optimal MG operations under SG environment, such as improved reliability, higher operation flexibility, peak shaving, lower energy cost, load balancing, auto control operation, protection, integrated EMS operation, More computation time, premature convergence to a local optimum solution.
[11] MOPSO PV-WT-BSS Reduction in operating cost with maximum MG revenue. A bidirectional operation to ensure higher reliability.
[12] GA PV-WT-CHP GA in energy management improved the ability for MG optimal scheduling. Multiple sets of the parameter are required for GA. matching load-generation capacity, minimum pollution, and improved power quality (PQ) [3]- [5]. Due to the inclusion of shiftable loads, MGs can apply demand response programs (DRPs) for balancing the system loads [6], [7]. Therefore, optimal scheduling and sizing problems are taken as critical issues. Moreover, the availability of RERs and their operation uncertainty have placed complex challenges for optimal operation [8], [9], which must be considered at the designing stage; so that the overall system can work properly. Different research articles with different strategies have been published on different scenarios of the problem with DRPs. Table 1 shows the comparison of different methods with related literature.
Various articles have been published on new heuristic methods. A discrete harmony searching technique was proposed in [20] to manage a PV-WT-BSS-DG hybrid model. A hybrid SA-TS algorithm was implemented in [21] to handle optimal configuration challenges. Reference [22] utilized MPSO to optimize the hybrid energy system (HES). A new two-layer iterative algorithm implemented the optimal allocation of grid-tied HES [23]. The first layer was implemented for RERs optimization, and the second layer was considered for optimal BSS capacity. In [24], SNO for optimal controller training of rule-based standalone HES was obtained. The authors in [25] introduced a double loop two-level hybrid technique with multiple heuristic optimization techniques for optimally allocated switching capacitors and reactive power managing. The multi-objective adaptive evolutionary technique is proposed in [26] for optimal allocation of hybrid PV-WT-BSS-DG system. Moreover, WGA-EMA with parallel processing quality is implemented in [27] for dynamically reconfiguring the MGs and distribution networks. In [28], novel multi-layer optimization with a time-dependent price algorithm is proposed for optimal sizing and planning of residential MGs to minimize energy costs.
Different software tools were used for MG optimization and EMS. HOMER was utilized in [29] for optimal allocation and size optimization of MG components. Moreover, technoeconomic size optimization of islanded MG was implemented in [30] with the help of HOMER and GAMS software tools. Some articles used deterministic and mathematical methods rather than heuristic algorithms. The authors in [31] proposed a novel deterministic optimization technique for size optimization of hybrid PV-WT-DG model. In [32], the MIPbased optimization method for MG planning was implemented to minimize risk in profit. Reference [33] used a new deterministic method by incorporating LCOE and LPSP for size optimization of the standalone PV-WT model. The authors in [34] proposed two-level predictive EMS with MILP for standalone MG. The first level was used for unit commitment, and the second level was implemented to regulate real-time MG operation.
The objective function selection is another critical problem that must be efficient and suitable to optimize sizes and allocation. Reference [21] uses size optimization's objective function to minimize the total MG energy cost. The objective function of hybrid MG is to minimize LCOE and LPSP while maximizing the RERs penetration [26]. The authors in [33] claimed optimal sizing to minimize investment costs with higher reliability. The authors in [35] introduced a novel smart scheme for size optimization and energy trading of standalone MGs clusters. Significant profit allocation for MG owners with enhanced overall system reliability are the main objectives of this study.
Various factors influence the MG performance in size optimization and allocation, such as DRPs, ESS, major uncertainties, and environmental challenges. Few articles have discussed the impact of these factors on MGs size optimization. The authors in [21] introduced RERs intermittency with sensitivity study on different case scenarios. In [36], optimization of a single objective function was used to find the optimal sizes of the MG components. Probability density functions (PDFs) were also used to incorporate RERs intermittency while finding the optimal sizes of the DGs. Reference [37] used deterministic uncertainty sets rather than PDFs to optimize MG sizes and placement. HES with a new techno-economic approach is implemented in [38] for the MG system designing. Load shifting scheme with priority load scenarios was used, and their impact on MG sizing was investigated. Reference [30] used DRPs for the cost reduction and improvement of the MG sizing method. In [39], the impact of DRPs and environment on optimal sizing was analyzed. This paper's uncertain nature of RERs and loads was not investigated. Moreover, twentyfour (24) hours' time steps were considered with yearly samples of RERs and loads. The authors in [29] investigated DERs combinations by utilizing the HOMER tool. Moreover, GHG emission was also considered in this study. Similarly, reference [31] investigated the impact of ESS on MG sizing. It was shown that BSS installation to a standalone HES reduced the investment cost.
In [40], the authors replaced the conventional method, which employed RTED with 5 to 15 minutes static snapshot forecasted data, including each minute variation data of RERs and load. DGs manage power unbalancing based on "best-fit" PFs obtained from previous ED, keeping the same objective dimension by evaluating only PFs at the start. This approach is applicable for both sequential and dynamic variability. Two test systems are used for the verification of the proposed scheme. The authors in [41] proposed SPEA 2+ for biobjective (total cost and system risk) ESRMC scheme for wind-thermal systems with two market models: thermal alone and thermal DGs with demand. Weibull PDF is employed for handling the stochastic nature of wind, while normal PDF is used for load. IEEE 30 bus system is validated with the proposed scheme. In [42], stochastic optimization technique is proposed for voltage and VAR control with OPF under variable loads and uncertainty of RERs. The proposed method is validated on a 24 bus system. In [43], the authors proposed an integrated optimal and dynamic fast and slow reserve action This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication.  [18].  DRPs and EVs load are not considered [19].  BSS charging and discharging scenarios of EVs are not investigated [17].  BSS of EVs and DE are not included [16].  DE emission cost and uncertain nature of load are not included [15].  Single loads are investigated without DE emission cost [14]. This paper proposes a joint optimization approach for the optimal planning and operation of grid-connected residential PV-WT-FC-DE based community rural microgrid (MG) integrated into EVs in view of multiple DRPs. A multiobjective optimization problem has been formulated to minimize the operating cost (C1), pollutant treatment cost (C2), and carbon emissions cost (C3). The load demand has been rescheduled in view of three DRPs such as CPP, RTEP, and TOU. Moreover, the EV load has also been analyzed in autonomous and coordinated charging strategies. The suggested multi-objective optimization problem is transformed into a single objective problem using a judgement matrix, and the results of the ABC algorithm are compared with the PSO algorithm. To analyze the impact of DRPs, the residential community rural MG is implemented for 50 homes with a peak load of 5 kW each and EV load of 80 EVs and 700 EVs, respectively. The main contributions of this paper can be summarized as:  Comparison of two heuristic algorithms under three DRPs.  Analysis in grid-connected MG increases the complexity of the optimization problem. However, the authors in recent literature mostly considered the islanded MG cases.  Consideration of RERs uncertainty and DRPs by employing ABC and PSO algorithms. However, literature studies lack: (1) the consideration of RERs uncertainty and DRPs, (2) grid-connected EVs integrated residential PV-WT-MT-DE based community rural microgrid (MG) by employing single-objective problem using ABC and PSO algorithms [44]- [57].  Analyzing tradeoff perspectives between two heuristic algorithms with load rescheduling as the major part of three DRPs.
 Investigating EVs load with autonomous and coordinated charging scenarios.  Rescheduling the load demand based on different tariffs as DRPs and economic dispatch (ED) by considering optimal sizing as DSM.  For incorporating the uncertainties in RERs, their stochastic nature is modeled with a probabilistic method.
The rest of the paper is organized as follows. Section II involves modeling of the studied MG system, in which the role of ABC and PSO algorithms is explained. The solution steps for applying ABC and PSO algorithms are also explained. Modeling of RERs uncertainty, WT, PV, load demand, fuel cell, and the diesel generator is also part of this section. Problem formulation is explained in Section III, which includes objective functions, and constraints. Section IV highlights all test cases which are analyzed in this paper. Simulation data for the study system is mentioned in Section V which includes unscheduled summer load, scheduled (summer and winter) loads with (CPP, RTEP, and TOU) tariffs. Section VI analyzes the results with discussion. Comparison between PSO and ABC for (summer and winter) loads with (unscheduled, CPP, RTEP, and TOU) tariffs during autonomous and coordinated modes of 80 EVs and 700 EVs, respectively are explained in detail. Section VII presents critical analysis and discussion. The conclusion is given in Section VIII. Fig. 2 shows the schematic configuration of the rural community microgrid under study. The initial data and components of the microgrid model under study are taken from the base papers [57], [58]. The details of the studied system can be seen from the base papers. ABC and PSO algorithms are not planning tools. They are metaheuristic algorithms used to solve the multi-objective optimization problem. This paper analyzes joint multi-objective optimization problems based on load scheduling and optimal sizing considering demand-side management (DSM). The first step involves DSM, and the second step involves optimal sizing, and it has been analyzed which algorithm (ABC or PSO) performs well for the proposed optimization problem is incorporated in this paper. Future planning also involves deciding the size and type of DG, which was emphasized in this paper. Conversion from multi-objective to single-objective is done with a judgment matrix by assigning weights, which are taken from base papers. ABC and PSO are then used for solving the optimization problem. VOLUME XX, 2017 Moreover, the diesel generator is the normal tradition in Pakistan as the main generation source for handling the basic load demand. Hence, adding a diesel generator is a reasonable choice for the extension of the MG system by incorporating the existing DGs. The MG model is suggested for the residential, rural community load of Shah Allah Ditta of Islamabad, Pakistan. The authors in [59] used the Indian location, while this paper used the Pakistani location. In this way, we tailored the proposed problem according to our local context. A community MG is studied in this paper formed by combining the prosumers close to serve multiple customers [49]. It may include residential customers (residential microgrid) or other community servings such as hospitals, public buildings, etc. [60].

II. MODELING OF THE STUDIED MICROGRID SYSTEM
The solution steps of applying the ABC algorithm for optimization problem are as follows: Step1: Initializing the solutions population X, i.e., the maximum number of bees MB, total number of iterations imax, the controlling parameter limit, lower (Xj, max) and upper (Xj, min) limits of the searching space, and random generated initial population (Xi i=1,2,3…., MB); Step2: Calculate the nectar value of the population through their fitness function.
Step3: Producing neighbouring solutions for the employed bees through random numbers and validating them according to step 2.
Step4: Applying the selection procedure.
Step5: Go to step 9 for distributed onlooker bees, otherwise, follow next step 6.
Step6: Calculate the probability values for the solutions.
Step7: Producing neighbouring solutions for the nominated onlooker bee, based on the value, through random numbers and applying step 2.
Step9: Determining the abandoned solution for the scout bees if available, and replacing it with an entirely new solution, and evaluating them according to step 2.
Step10: Save the best solution obtained so far.
Step11: Stopping and printing results if the maximum number of iterations is reached. Otherwise, repeat step 3.
The PSO process for solving the optimization problem is as follows: Step1: Start initialization of the swarm with its velocity and position, coefficients, and maximum iterations.
Step2: Initialize X and V.
Step3: Set the objective as a fitness value.
Step4: Calculate the fitness of each swarm for personal best Pbest, while comparing with other swarms for global best Gbest.
Step5: Modify swarm velocity and position.
Step6: Modify the personal best Pbest and global best Gbest solutions accordingly.
Step7: Repetitions of steps 5 and 6 until achieving the limit for maximum iterations tmax.
Step8: The end product is global best Gbest, personal best Pbest, and its relevant position X.

A. UNCERTAINTY MODELING OF RER
Integrating renewable energy resources (RERs), such as solar and wind, can be an alternative approach to saving the environment from contaminated fossil fuel-based power generation. Nevertheless, the main complexities involve modeling the uncertain and intermittent nature of these RERs worsening the MG planning. Consequently, MG optimal scheduling with the modeling of the uncertain and intermittent nature of RERs is analyzed in this work, considering the scenario in which MG is operating in gridconnected under autonomous and coordinated modes. With optimal scheduling, the proposed MG system can schedule the load and manage the optimal sizing of DGs for optimal power generation. Besides diesel generators, other RERs are used for load scheduling based on variable and unpredictable load demands. Their stochastic nature is modeled with a probabilistic method for uncertainty modeling MG components, such as solar and wind. The mathematical modeling for these three scenarios can be written as follows [51]: where E(xt) denotes the expectation of variable xt at time t, Pn(xt) shows the probability of xt at scenario n. The E values are calculated, then used in the optimization algorithms, and three cost objectives are obtained.

B. POWER GENERATION MODELING OF PV AND WT
Renewable energy resources such as solar and wind are the best choices abundant in nature and easily accessible. The output power of each PV and WT unit are highly dependent on solar irradiation and wind speed, respectively. The PV output power in [59] is represented as 2 () .
where cut-in, cut-out, and average rated wind speeds are taken as 3, 25, and 5.71 m/s, respectively.
Average wind speed is mentioned only for the selected site's information, but the authors have used hourly wind speed data. Moreover, the power curve of the selected wind turbine XANT M-21 is also shown in Fig. 3. Hub height is 31.80 m, while rotor diameter is 21 m. This type of wind turbine is easy to transport and can be erected without support from a crane. Their design is based on JEEP (just enough essential parts) to save capital. This WT design is aligned with the IEC 64100-1 and GL standards.

C. MODELING OF LOAD DEMAND
For a practical scenario, hourly load demand varies significantly because of various energy utilization patterns at the consumer's end. The mathematical relationship of the normal distribution function (fnd(t)) for load demand is expressed as follows [59]  

D. MODELING OF FUEL CELL (FC)
The mathematical modeling of the FC power is represented as follows [

E. MODELING OF DIESEL GENERATOR
Diesel engine (DE) generators are normally used as backup sources. The fuel consumption (FDG (t)) and generation cost (CDG(t)) of DE generator are expressed as follows [59]   where F1 and F2 are taken as 0.08415 and 0.246 in litre/kWh, respectively [62], [63].

III. PROBLEM FORMULATION
The total annualized cost and emission objectives are taken in this combined optimal planning and operation modeling concerning economic and environmental perspectives. The suggested multi-objective problem is devised as follows The objective functions and their constraints are mathematically modeled as follows [64]- [66].

1) TOTAL ANNUALIZED COST (TAC)
The minimization of TAC of a grid-connected residential, rural microgrid is formulated as follows [59]  

3) OPERATION COST
The OC ( OC ) of the microgrid is expressed [57]: . min (1 ) (16) where Fuel , OM , GRID , LS , and N represent costs for fuel; O&M; MG-Grid coordination; compensation cost for load interruption; grid On/Off, respectively. N=1 indicates MG is connected with the grid, while N = 0 shows an islanded operation.
The depreciation cost ( () OC DC ) is determined [57]: a , l and max P are output power; capacity factor; installation costs; interest rates (8%); DGs life; and DGs maximum capacity, respectively.

4) POLLUTANT TREATMENT COST
The pollutant treatment cost ( PTC ) of the microgrid is [57]:

and
Grid P represent DGs sum; pollutant emission type; treatments cost; emission coefficient; coefficient of grid pollutant emission; and grid output power, respectively.

1) DER SIZING
The sizing constraint of each MG component is mathematically represented as [59]  2) POWER BALANCE At any given time t, the difference of total load demand and total power generation must be equal to zero, which can be represented as follows [59]

3) DG POWER LIMITS
The power limits for DG units can be represented as follows [59]

4) EXCHANGING POWER LIMIT
The power exchanging limits between grid and MG can be represented as follows [59]

5) EV BATTERY CHARGING/DISCHARGING LIMITS
The charging and discharging limits of BSS can be represented as follows [59] The SOC constraint of BSS can be represented as follows [59] At any given time interval t, the sum of total charged energy and initial energy level must be greater than the total discharged energy of the battery. It can be represented as follows [59]

6) RAMP RATE LIMITS
DEs ramp rate can be represented as [57]:

DE
Pt  , max r and t are outputs; maximum ramp rate, and time interval, respectively.

7) LINE TRANSMISSION CAPACITY
Power flow between MG and PG is expressed as [57]: shows the maximum line capacity.

IV. TEST CASES
The grid-  The maximum wind speed of this location is 6.99 m/s (April), while the annual average speed is 5.71 m/s. This rural town is 700 years old and was used to route from Kabul (Afghanistan) to the Gandharan city of Taxila (Hindustan) by Alexander the Great and Sher Shah Suri. Other emperors, including Mughal rulers, frequently travelled from Afghanistan to the Hindustan [52].

V. SIMULATION DATA FOR STUDY SYSTEM
The grid-connected residential, rural community MG is analyzed under different RERs and DGs. Different costs (such as annual capital, O&M, and emission coefficients) and other DER parameters are taken from [48], [51], [53], [54]. The power limits of all DGs are adopted from [46]. Home appliances details are taken from [71]- [76]. The total number of 50 smart residential, rural consumers, are considered. Three pricing schemes (CPP, RTEP, and TOU) are used to handle power exchanging costs between the grid, and MG. Fig. 5 shows the power output curves of solar and wind used in this study. The time step of the simulation is based on 24 hours. Therefore, the estimated profile of 24 hours is shown to find cost by solving the optimization problem with 24 hours. The data is taken from the base papers [57], [58], which used 24 hours in their simulation. Fig. 6 shows the total unscheduled load for summer and winter. Fig. 7 shows the TOU tariff for an unscheduled load. All other load conditions with CPP and RTEP tariffs are taken from base paper [78].    EVs load. It is shown that the load with EVs increased from 1400 onward compared to the load without EVs. The peak load is almost 250 kW, the same peak value with and without EVs load. Fig. 8b shows the same procedure for coordinated mode. It is observed that EVs introduced more charging load during the morning (0100 to 0800) while contributing the power in the evening (1700-2400). The peak loads are observed as 370 kW and 250 kW with and without EVs load. In Fig.9a, EVs load absorbs energy throughout the day during autonomous mode with a peak load of 790 kW. The peak load without EVs remained at 250 kW in all summer tariffs. Fig.  9b shows that EVs are in charging mode in the morning (0100-0800) while in discharging mode in the evening (1600-2400). The peak load is recorded as 1800 kW.

1) UNSCHEDULED SUMMER LOAD
2) CPP SCHEDULED SUMMER LOAD Fig. 10 shows the CPP tariff of summer load with peak pricing at 1200-1600 due to hot weather while maximum usage of cooling load. The peak pricing value of the CPP tariff is 5.5 which is greater than the unscheduled tariff peak of 1.4. Fig. 11a and Fig. 11b show almost the same trend as the relevant graph of unscheduled load but with the peak value of 320 kW and 440 kW, respectively. Similarly, Fig.  12a and Fig. 12b show a similar profile compared to unscheduled load but with the peak load demand of 900 kW 2000 kW, respectively.   Fig. 16a and Fig. 16b show the TOU load profile for autonomous and coordinated modes with 80 EVs, respectively. Fig. 17a and Fig. 17b show the autonomous and coordinated modes with 700 EVs, respectively.  Fig. 18b show the unscheduled load profile for autonomous and coordinated modes with 80 EVs, respectively. Fig. 19a and Fig. 19b show the unscheduled load profile for autonomous and coordinated modes with 700 EVs, respectively.     Fig. 27 show the scheduled load profiles for summer and winter, respectively. Fig. 28a and Fig. 28b show the autonomous and coordinated EVs load profiles with three scenarios of EVs. Still, this study's analysis includes only two scenarios of EVs, such as 80 EVs and 700 EVs. Fig. 29a and Fig. 29b show the unscheduled convergence curves for 80 EVs during autonomous and coordinated modes, respectively. It is observed that the performance of the ABC algorithm is better in autonomous mode, while PSO performed well in coordinated mode. Table 2 shows the  computational burden of unscheduled load under different  circumstances. These table values are used as the base values  for comparing three DRPs.  Table 3 shows data for the CPP summer tariff. During the CPP summer tariff, a significant reduction of computational burden is observed in the PSO algorithm for 80 EVs in autonomous mode. The simulation time reduction is also observed with ABC and PSO for 80 EVs in autonomous and coordinated modes, respectively. All remaining scenarios show more computational burden as compared to the base case. Fig. 30a and Fig. 30b show the convergence curves for the RTEP summer tariff. The almost same trend of final convergence is observed for both algorithms during autonomous and coordinated modes. Table 4 shows the data of simulation time for RTEP summer tariff. During the RTEP summer tariff, a significant reduction in computational burden is observed with PSO for 80 EVs in autonomous mode. The simulation time reduction is also observed with PSO for 80 EVs and 700 EVs in coordinated and autonomous modes, respectively. All remaining scenarios show more computational burden as compared to the base case. Fig. 31 shows the convergence curve for the TOU summer tariff. It is observed that the performance of the PSO algorithm is better in coordinated mode. Table 5 shows the data of simulation time for the TOU summer tariff. During the TOU summer tariff, a significant reduction in computational burden is observed with PSO for 80 EVs in autonomous mode. The simulation time reduction is also observed with PSO and ABC for 80 EVs in coordinated and autonomous modes, respectively. All remaining scenarios show more computational burden as compared to the base case.    1) UNSCHEDULED SUMMER LOAD Fig. 32a and Fig. 32b show PSO-based unscheduled load scheduling with 80 EVs in autonomous and coordinated modes. During autonomous mode, excess energy from DGs is supplied to the grid for three hours in the early morning (0100-0300) and one hour afternoon (1300). EVs charging load is negligible during the starting day time (0600-1300), while EVs discharging load is significantly increased (above 50 kW) during the second half-day (1600-2300). DE is supplying power at an almost constant rate, while the main grid handles FC power fluctuations. During coordinated mode, excess energy from DGs is supplied to the grid for the second half-day (1700-2200). EVs discharging load is significant during the start of the day (0100-0700), while EVs charging load is significantly increased during the second half of the day (1700-2400). DE supplies negligible power at an almost constant rate, while the main grid handles  EVs power fluctuations. Fig. 33a and Fig. 33b show ABC-based unscheduled load scheduling with 80 EVs in autonomous and coordinated mode. During autonomous mode, excess energy from DGs is supplied to the grid for three hours in the early morning (0100-0300) and at different daytime (0800, 1000, 1300-1400, 2100). EVs charging load is negligible during the starting day time (0600-1400), while EVs charging load is significantly increased (above 50 kW) during the second half-day (1600-2300). DE is supplying power with slightly changing power output, while the main grid handles FC power fluctuations. During coordinated mode, excess energy from DGs is supplied to the grid for the second half-day (1700-2200). EVs discharging load is significant during the start of the day (0100-0700), while EVs charging load is significantly increased during the second half of the day (1700-2400). DE is supplying constant power at the start of the day (0100-0700) and almost negligible power during midday (0800-1800), while no power during nighttime (1900-2300). EV excess power is supplied to the main grid (1700-2400). The demand-generation mismatch is supplied by RERs (PV, WT). Fig. 34a and Fig. 34b show unscheduled load scheduling with 700 EVs in autonomous and coordinated modes, respectively. During autonomous mode, EVs charging load is more during the starting day (0100-0700), while EVs charging load is significant throughout the simulation with a 700 kW peak during the night (2000). DE and FC are supplying almost constant power. During coordinated mode, excess energy from DGs is supplied to the grid at night (1600-2400). EVs charging load is more during the starting day (0100-0700), while EVs discharging load is significant at night (1700-2400). DE and FC are supplying almost negligible power. Fig. 35a and Fig. 35b show unscheduled load scheduling with 700 EVs in autonomous and coordinated modes, respectively. The almost same trend of PSO-based modes is observed during autonomous and coordinated modes. The demand-generation gap is supplied by RERs (PV, WT).   Table 7 shows unscheduled load results during scheduling scheme 1 (autonomous) and scheduling scheme 2 (coordinated), respectively. The data of these tables are used as the base case for three DRPs. 2) CPP SCHEDULED SUMMER LOAD Fig. 36a and Fig. 36b show the CPP summer load scheduling with 80 EVs in autonomous and coordinated modes, respectively. Excess energy from DGs is supplied to the grid (0600, 0800-1300). EVs charging load is negligible during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400). DE supplies power at an almost constant rate, while FC power is variable. Excess energy from DGs is supplied to the grid (0800, 1000-1400, 1700-2000). EVs charging load is significant during the start of the day (0100-0700), while EVs discharging load is significantly increased during the second half of the day (1700-2400). DE is supplying almost constant power. Fig. 37a and Fig. 37b show ABC-based CPP summer load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0800-2200). EVs charging load is significant during the starting day (0100-0700), while EVs discharging load is significantly increased during the second half-day (1700-2400). DE supplies power at the start of the day till noon with a slight change in power output afternoon, while FC power fluctuates. Excess energy from DGs is supplied to the grid (0800-2200). EVs discharging load is significant during the start of the day (0100-0700), while EVs discharging load is significantly increased during the second half of the day (1700-2400). DE supplies constant power at the start of the day and almost negligible power at night. EV excess power is supplied to the main grid (1700-2400), while the demandgeneration mismatch is supplied by RERs (PV, WT). Fig. 38a and Fig. 38b show PSO-based summer CPP load scheduling with 700 EVs in autonomous and coordinated modes. EVs charging load is significant during the autonomous mode throughout the daytime with a 700 kW peak at night (2000). DE and FC are supplying almost constant power. During coordinated mode, excess energy from DGs is supplied to the grid at night (1700-2400). EVs charging load is more during the starting day (0100-0700), while EVs discharging load is significant at night (1700-2400). DE and FC are supplying almost negligible power. Fig. 39a and Fig. 39b show ABC-based summer CPP load scheduling with 700 EVs in autonomous and coordinated modes. The almost same trend of PSO-based modes is observed during autonomous and coordinated modes. The demand-generation gap is supplied by RERs (PV, WT).  Table 8 shows CPP summer load scheduling results for 80 EVs during scheduling scheme 1 (autonomous) and scheduling scheme 2 (coordinated). During autonomous mode, the ABC algorithm outperformed PSO by reducing all four costs, such as the operating cost (C1), pollutant treatment cost (C2), carbon emissions cost (C3), and the overall cost (C). The ABC algorithm also outperformed PSO during coordinated mode by reducing three costs C1, C3, and C. Table 9 shows the CPP summer load scheduling results for 700 EVs during scheduling scheme 1 (autonomous) and scheduling scheme 2 (coordinated). During autonomous mode, the ABC algorithm performed better by reducing all four costs such as C1, C2, C3, and C. The PSO algorithm performed better by reducing one cost, such as C2. Both ABC and PSO algorithms performed better during coordinated mode by reducing all four costs such as C1, C2, C3, and C. Significant reduction in cost C3 is observed during both ABC and PSO algorithms. However, ABC reduced C3 cost twice as compared to PSO.  3) RTEP SCHEDULED SUMMER LOAD Fig. 40a and Fig. 40b show PSO-based RTEP summer load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0100-0300). EV charging load is negligible during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400), and Excess energy from DGs is supplied to the grid (1700-2200). EVs charging load is significant during the start of the day (0100-0700), while EVs discharging load is significantly increased during the second half of the day (1700-2400). DE is supplying almost constant power. Fig. 41a and Fig. 41b show ABC-based RTEP summer load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0500, 0800, 1000, 1200-1300). EVs charging load is significant during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400). Excess energy from DGs is supplied to the grid (0800-1000, 1200-1300, 1700-2100, 2300-2400). EVs charging load is significant during the start of the day (0100-0700), while EVs discharging load is significantly increased during the second half of the day (1700-2400). Fig. 42a and Fig. 42b show PSO-based RTEP summer load scheduling with 700 EVs in autonomous and coordinated modes. EVs charging load is significant during the autonomous mode throughout the daytime with a 700 kW peak at night (2000). During coordinated mode, excess energy from DGs is supplied to the grid at night (1600-2400). EVs charging load is more during the starting day (0100-0700), while EVs discharging load is significant at night (1700-2400). Fig. 43a and Fig. 43b show ABC-based RTEP summer load scheduling with 700 EVs in autonomous and coordinated modes. The almost same trend of PSO-based modes is observed during autonomous and coordinated modes. Table 10 shows RTEP summer load scheduling results for 80 EVs during autonomous and coordinated modes. The PSO algorithm performed better during autonomous mode by reducing one cost, such as C2. The PSO algorithm performed better during coordinated mode by reducing three costs such as the C1, C3, and C. Table 11 shows RTEP summer load scheduling results for 700 EVs during autonomous and coordinated, while the ABC algorithm performed better during autonomous mode by reducing all four costs. Both ABC and PSO algorithms performed better during coordinated mode by reducing all four costs. A significant reduction in cost C3 is observed during the ABC algorithm. Fig. 44a and Fig. 44b show PSO-based TOU summer load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0800-1300). EV charging load is negligible during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400), and excess energy from DGs is supplied to the grid (0700-2400). EVs charging load is significant during the start of the day (0100-0700), while EVs discharging load is significantly increased during the second half of the day (1700-2400).   Fig. 45a and Fig. 45b show ABC-based TOU summer load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (1000-1300). EVs charging load is small during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400). Excess energy from DGs is supplied to the grid (1000-1300). EVs charging load is small during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400). Fig. 46a and Fig. 46b show PSO-based TOU summer load scheduling with 700 EVs in autonomous and coordinated modes. EVs charging load is significant during the autonomous mode throughout the daytime with almost 700 kW peak at night (2000). During coordinated mode, excess energy from DGs is supplied to the grid at night (1600-2400). EVs charging load is more during the starting day (0100-0700), while EVs discharging load is significant at night (1700-2400). Fig. 47a and Fig. 47b show ABC-based TOU summer load scheduling with 700 EVs in autonomous and coordinated modes. The almost same trend of PSO-based modes is observed during autonomous and coordinated modes. Table 12 shows TOU summer load scheduling results for 80 EVs during autonomous and coordinated modes. Both PSO and ABC algorithms performed better during autonomous mode by reducing all four costs. A significant reduction in cost C2 is observed during both PSO and ABC algorithms. During coordinated mode, the ABC algorithm performed better by reducing all four costs such as the C1, C2, C3, and C. PSO algorithm performed better by reducing three costs such as the C1, C3, and C. Significant reduction in cost C3 with PSO and C2 with ABC are observed. Table 13 shows TOU summer load scheduling results with 700 EVs. The ABC algorithm performed better during autonomous mode with the reduction of all four costs. The PSO algorithm performance is better with a reduction of C1, C3, and C. Both algorithms performed better during coordinated mode by reducing all four costs. A significant reduction in C3 is observed with both algorithms. However, cost reduction with ABC is 1.5 times as compared to PSO.  Fig. 49 show the unscheduled convergence curves for winter load during autonomous mode for 80 EVs and 700 EVs, respectively. It is observed that the performance of the ABC algorithm is better with 80 EVs, while both performed well with 700 EVs. Table 14 shows the computational burden of unscheduled load under different circumstances. These table values are used as the base values for the comparison of three DRPs. Fig. 50 and Fig. 51 show the convergence curves for CPP winter tariff during autonomous mode for 80 EVs and 700 EVs, respectively. It is observed that the performance of the ABC algorithm is better with 80 EVs, while both performed well with 700 EVs. Table 15 shows data for the CPP winter tariff. During the CPP winter tariff, no significant reduction of computational burden is observed. The simulation time reduction is only observed with PSO for 700 EVs in autonomous mode. All remaining scenarios show more   computational burden as compared to the base case. Fig. 52 and Fig. 53 show the convergence curves for the RTEP winter tariff. It is observed that the performance of the PSO algorithm is better for both cases, with 80 EVs and 700      EVs in autonomous mode. Table 16 shows the data of simulation time for RTEP winter tariff. During the RTEP winter tariff, no significant reduction in computational burden is observed. All scenarios show more computational burden as compared to the base case. Fig. 54 shows the convergence curve for the TOU winter tariff. It is observed that the performance of both algorithms is better in coordinated mode with 80 EVs. Table 17 shows the data of simulation time for the TOU winter tariff. During the TOU winter tariff, no significant reduction in computational burden is observed. All scenarios show more computational burden as compared to the base case. Fig. 55a and Fig. 55b show PSO-based unscheduled winter load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0100-0700, 0900-1000, 1300-1400, 1900-2400). EVs charging load is negligible during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400). Excess energy from DGs is    supplied to the grid (0600, 0900, 1300-2400). EVs charging load is significant during the start of the day (0100-0700), while EVs discharging load is significantly increased during the second half of the day (1700-2400). Fig. 56a and Fig. 56b show ABC-based unscheduled winter load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0100-0700, 1000, 1300-1400, 2100-2400). EVs charging load is small during the starting day (0100-1400), while EVs' charging load increases during the second halfday (1500-2400). Excess energy from DGs is supplied to the grid (0600-0700, 0900, 1300-2400). EVs charging load is small during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400). Fig. 57a and Fig. 57b show PSO-based unscheduled winter load scheduling with 700 EVs in autonomous and coordinated modes. EVs charging load is significant during the autonomous mode throughout the daytime with almost 700 kW peak at night (2000). During coordinated mode, excess energy from DGs is supplied to the grid at night (1600-2400). EVs charging load is more during the starting day (0100-0700), while EVs discharging load is significant at night (1700-2400).  Fig. 58b show ABC-based, unscheduled winter load scheduling with 700 EVs in autonomous and coordinated modes. Almost the same trend of PSO-based modes is observed during autonomous and coordinated modes. Table 18 and Table 19 shows unscheduled load results during scheduling scheme 1 (autonomous) and scheduling scheme 2 (coordinated), respectively. The data of these tables are used as the base case for three DRPs. Fig. 59a and Fig. 59b show PSO-based CPP winter load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0100-1400). EVs' charging load is negligible during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400), and Excess energy from DGs is supplied to the grid (0600-2400).

2) CPP SCHEDULED WINTER LOAD
EVs charging load is significant during the start of the day (0100-0700), while EVs discharging load is significantly increased during the second half of the day (1700-2400).    Fig. 60b show ABC-based CPP winter load scheduling with 80 EVs in autonomous and coordinated modes, respectively. Excess energy from DGs is supplied to the grid (0100-1700, 2000). EVs' charging load is small during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400), and Excess energy from DGs is supplied to the grid (0600-2200). EVs charging load is large during the starting day (0100-0700), while EVs' discharging load increases during the second half-day (1700-2400). Fig. 61a and Fig. 61b show PSO-based CPP winter load scheduling with 700 EVs in autonomous and coordinated modes, respectively. EVs charging load is significant during the autonomous mode throughout the daytime with almost 700 kW peak at night (2000). During coordinated mode, excess energy from DGs is supplied to the grid at night (1600-2400). EVs charging load is more during the starting day (0100-0700), while EVs discharging load is significant at night (1700-2400). Fig. 62a and Fig. 62b show ABC-based CPP winter load scheduling with 700 EVs in autonomous and coordinated modes. The almost same trend of PSO-based modes is observed during autonomous and coordinated modes.  scheduling scheme 2 (coordinated). During autonomous mode, the ABC algorithm performed well by reducing three costs, such as C1, C3, and C. PSO algorithm performed well by reducing one cost such as C2. The ABC algorithm performed better during coordinated mode by reducing one cost, such as C3. PSO algorithm performed better by reducing one cost such as C1. Table 21 shows the CPP winter load scheduling results for 700 EVs during scheduling scheme 1 (autonomous) and scheduling scheme 2 (coordinated). During autonomous mode, both algorithms performed better by reducing three costs such as C1, C3, and C. During coordinated mode; both algorithms performed better by reducing all four costs. A significant reduction in cost C3 is observed during both algorithms. However, PSO reduced C3 cost twice as compared to ABC. Fig. 63a and Fig. 63b show PSO-based RTEP winter load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0100-0700, 0900-1000, 1300-1400, 1700, 2100-2400). EVs  charging load is negligible during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400). Excess energy from DGs is supplied to the grid (0700, 0900-1000, 1300-1400, 1600-2400). EVs charging load is significant during the start of the day (0100-0700), while EVs discharging load is significantly increased during the second half of the day (1700-2400). Fig. 64a and Fig. 64b show ABC-based RTEP winter load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0100-1400, 1700). EVs' charging load is small during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400), and excess energy from DGs is supplied to the grid (0600-1400, 1700-2400). EVs' charging load is large during the starting day (0100-0700), while EVs discharging load is significantly increased during the second half-day (1700-2400). Fig. 65a and Fig. 65b show PSO-based RTEP winter load scheduling with 700 EVs in autonomous and coordinated modes. EVs charging load is significant during the autonomous mode throughout the daytime with almost 700 kW peak at night (2000). During coordinated mode, excess energy from DGs is supplied to the grid at night (0300-0700, 0900). EVs charging load is more during the starting day (0100-0700), while EVs discharging load is significant at night (1700-2400). Fig. 66a and Fig. 66b show ABC-based RTEP winter load scheduling with 700 EVs in autonomous and coordinated modes. Almost the same trend of PSO-based modes is observed during autonomous and coordinated modes. Table 22 shows RTEP winter load scheduling results for 80 EVs during autonomous and coordinated modes. During autonomous mode, the ABC algorithm performed better by reducing three costs, such as C1, C3, and C. PSO algorithm performed better by reducing one cost such as C2. The ABC algorithm performed better during coordinated mode by reducing one cost, such as C3. The PSO algorithm performed better by reducing two costs, C2 and C3. A significant reduction in cost C2 is observed during the PSO algorithm.   Fig. 67a and Fig. 67b show PSO-based TOU winter load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0100-0700, 0900-1000, 1300-1400, 1700, 1900, 2100-2400). EVs charging load is negligible during the starting day (0100-1400), while EVs' charging load increases during the second half-day (1500-2400). Excess energy from DGs is supplied to the grid (0600-0700, 0900, 1400, 1600-2400). EVs charging load is significant during the start of the day (0100-0700), while EVs discharging load is significantly increased during the second half of the day (1700-2400). Fig. 68a and Fig. 68b show ABC-based TOU winter load scheduling with 80 EVs in autonomous and coordinated modes. Excess energy from DGs is supplied to the grid (0100-1000, 1200-1500, 1700, 1900-2400). EVs' charging load is small during the starting day (0100-1400), while EVs'  charging load increases during the second half-day (1500-2400). Excess energy from DGs is supplied to the grid (0900-1000, 1300-2400). EVs charging load is large during the starting day (0100-0700), while EVs' discharging load increases during the second half-day (1700-2400). Fig. 69a and Fig. 69b show PSO-based TOU winter load scheduling with 700 EVs in autonomous and coordinated modes. EVs charging load is significant during the autonomous mode throughout the daytime with almost 700 kW peak at night (2000). During coordinated mode, excess energy from DGs is supplied to the grid at night (0700, 0900, 1600-2400). EVs charging load is more during the starting day (0100-0700), while EVs discharging load is significant at night (1700-2400). Fig. 70a and Fig. 70b show ABC-based TOU winter load scheduling with 700 EVs in autonomous and coordinated modes. The almost same trend of PSO-based modes is observed during autonomous and coordinated modes. Table 24 shows TOU winter load scheduling results for 80 EVs during autonomous and coordinated modes. Both PSO and ABC algorithms performed better during autonomous mode by reducing three costs such as C1, C3, and C. Significant reduction in cost C3 is observed during the ABC algorithm. Both ABC and PSO algorithms performed better

VIII. CONCLUSION
In this paper, the joint optimization modeling approach is proposed for the planning and operation of grid-connected residential MGs with the help of demand response programs (DRPs). The constraints complexity of many smart residential appliances is included in the DRPs load shifting process. Proposed model performance is investigated with and without DRPs under summer and winter load data. MG planning and operation optimization models are validated while comparing different results with two algorithms, i.e., ABC and PSO.
Overall assessment of results showed that the proposed MG planning and operation modeling approach can provide good solutions while maximizing RERs and EVs integration with the support of DRPs.