Multi‐objective optimal planning of EV charging stations and renewable energy resources for smart microgrids

Distribution system planners and operators have increasingly exposed great attention to maximizing the penetration of renewable energy resources (RERs), and electric vehicles (EVs) toward modern microgrids. Accordingly, intensive operational and economic problems are expected in such microgrids. Specifically, the operators need to meet the increased demand for EVs and increase the dependence on RERs. The charging strategy for EVs and the RER penetration level may result in increased power loss, thermal loading, voltage deviation, and overall system cost. To address these concerns, this paper proposed an optimal planning approach for allocating EV charging stations with controllable charging and hybrid RERs within multi‐microgrids, where the charging strategy in the proposed planning approach contributed to improving power quality and overall system cost, where the voltage deviation, energy not supplied, total cost have been reduced to 26.03%, 49.57%, and 70.45%, respectively. The simulation results are compared with different optimization techniques to verify the effectiveness of the proposed algorithm. The proposed simultaneous allocation approach of EV charging stations and RERs can reduce operating costs for RERs and conventional stations while increasing the charging stations' capacity.


| INTRODUCTION
Renewable energy resources (RERs) are considered an essential supply for microgrids despite the capital cost of generated power from classical sources being lower than renewable energy sources but with optimal size and location for hybrid renewable energy sources, such as solar and wind energy in the presence of classical sources in microgrid leads to reduce the overall cost of energy. Electric vehicles (EVs) with renewable sources provide considerable benefits; however, increasing the number of EVs has a significant impact on the performance of microgrids, such as stability of the system, excessive power losses, and voltage deviation. So, supplying the high, increasing demand for charging EVs, keeping the microgrid operating constraints under control, and enhancing power quality are significant issues facing the world. Accordingly, energy management of the microgrid is affected by the sizing and location of RERs and charging stations. Therefore, the optimal planning approach for these control variables can tackle the mentioned problems, where the sizing and location affect power flow in the microgrid resulting in changes in power loss, voltage deviation, and overall cost.
Many studies discussed optimal hybrid renewable energy sources with EVs in the microgrid. The authors in refs. [1,2] have proposed a machine learning-based energy management for renewable microgrids and considering the charging demand of EVs. An optimization-based method has been presented in refs. [3][4][5] for the day-ahead operation of microgrids considering EVs and RERs. In ref. [6], the authors have developed a fuzzy cloud stochastic framework for managing the energy of microgrids with RERs based on the maximum distribution of EVs. An energy management system has been optimized for transferring power between vehicles (vehicle-to-vehicle) in the microgrid by using a smart aggregator. 7 In ref. [8], EVs' behavior was assessed by considering the effect of uncontrolled and smart charging modes on the optimal operation of microgrids. The EVs' optimal allocation and scheduling operation problems in distribution systems are discussed in refs. [9][10][11]. A stochastic energy management algorithm has been proposed in ref. [12] to address the contribution of smart microgrids in the electricity market while minimizing the total cost and determining the optimal size of RERs. In ref. [13], the authors explained the effect of fluctuated power generated by photovoltaic panels and introduced the EV as energy storage to supply the grid with power in urgent conditions. In ref. [14], the authors proposed an environmental footprint in three different locations across Europe for reducing the emission of carbon dioxide gas by an efficient planning approach for the optimal RERs with battery storage for balancing the gap between electricity production and demand. In ref. [15], the authors reviewed the methodology of numerous studies for managing the energy of microgrids including RERs, conventional distributed generators, and the impact of participating smart homes in demand response and charging stations on the technical and economic operation of the systems. In ref. [16], the authors proposed an efficient planning operation for multi-microgrids that included RERs, energy storage, and conventional sources by demonstrating the impact of multi-microgrid participation as a price maker by interaction with the electricity market on the optimal economic operation of the system. In ref. [17], the authors developed an approach for meeting maximum load demand with the lowest cost possible under changing weather conditions and dynamic analysis for transient disturbance in an off-grid by optimal configuration from various system combinations of the solar station, energy storage, hydropower station, and conventional sources. In ref. [18], the authors expressed the optimal scheduling of conventional sources in the presence of participation EVs in demand response to find the optimal charging rate according to the cost of the charging from the grid and to satisfy the requirements of the grid by minimizing power loss and voltage deviation and cost of generation. In ref. [19], the authors expressed the impact of coordinated charging, and uncoordinated charging of vehicles in smart grids on power loss, voltage deviation, and system efficiency. In ref. [20], the authors expressed the type of charging (low, medium, and fast) units in stations connected to the grid to obtain the optimal number of these charging units and the location of charging stations. In ref. [21], the authors considered the EV's uncertainty and solar irradiation, where the charging station is connected to the grid by the smart aggregator for controlling EV charging and discharging. Furthermore, the impact of solar energy on the price of electricity sold to EVs, as the microgrid acts as a price maker. In ref. [22], the authors expressed the optimal integration of EVs with considering wind speed uncertainty. Further, the effect of controllable and uncontrollable charging on the dispatchable time of microturbines and the power generated by them through different wind speed scenarios. In ref. [23], the authors expressed the optimal oversizing of the inverter of renewable energy stations considering the uncertainty of solar irradiance and wind speed with various percentages of penetration of RERs and the capability of the inverter in absorbing and injecting reactive power to avoid any voltage fluctuation during the transient change in the weather. In ref. [24], expressed uncertainty of generated power by photovoltaic panels and optimal scheduling of charging and discharging EVs for minimizing the voltage deviation by the capability of the inverter of RER in injection and absorption reactive power for regulating the voltage to avoid changing the position of the tap changer of the transformer. As demonstrated above, power system designers and operators are increasingly focused on boosting the integration of RERs and EVs into contemporary microgrids. As a result of the intermittent RER generation and fluctuating charging or discharging of EVs, such microgrids are predicted to have severe operational and economic difficulties. Specifically, operators must fulfill the rising demand for EVs while increasing reliance on RERs rather than traditional stations. Still, this task is fraught with growing power loss, voltage variation, and RER construction costs. As previously stated, various procedures for optimal energy management of distribution systems have been introduced. However, most of these works ignore proposing multi-objective functions in multi microgrids for improving technical operation and reducing economic cost simultaneously and increasing the reliance on RERs for reducing energy not supplied (ENS), voltage deviation, overall cost, meeting the increased demand for EVs, and enhancing load factor. This article suggests an optimal planning technique for identifying the locations and sizes of EV charging stations with controlled charging and hybrid RERs (wind and photovoltaic systems) inside a microgrid. A multi-objective function was proposed by a novel meta-heuristic method called jellyfish search optimizer (JSO) 25 to find the best placements and sizes of EV charging stations and RERs reduce power loss voltage variations and lower overall system cost. The simulation results were compared by JSO to particle swarm optimization (PSO), ant lion optimization (ALO), and sine cosine algorithm (SCA) to validate the proposed approach's efficiency. Despite the multi-objective planning model's complexity, the presented JSO-based approach can give the best answers in all scenarios in a large-scale 118-bus microgrid. The suggested simultaneous deployment of EV charging stations and intermittent RES can lower operating costs for both renewable and conventional stations while boosting EV charging station capacity. The JSO has been proposed for solving the allocation problem of the EV charging station and RERs due to its ability to find the global solution, which is based on three searching strategies including the active motion, passive motion, and logistic map mechanism, which boost the searching capability and avoid its stagnation to local optima.
The contributions of this paper can be listed below: 1. Proposing an optimal simultaneous allocation of the EV charging station with hybrid RER in the multimicrogrid under the operator's constraints. 2. Unlike previous planning models, the proposed approach stands out for its latent to enhance the operation of the microgrid by adjusting the control variables of RERs and EVs simultaneously. 3. Reducing the waiting queues, capital cost, and operating cost of RERs and enhancing load factor. 4. Constructing a multi-objective function that includes voltage, deviations, ENS, and the overall annual cost of energy in a microgrid. 5. Developing a heuristic optimization method called a jellyfish optimizer for minimizing multi-objective functions.
This paper is structured as follows: Section 2 presents the problem formulation, which includes the objective function, constraints, and modeling of RERS, and EVs. Section 3 gives a review of the JSO method and the system's construction. Section 4 presents the simulation results. Finally, the work is concluded in Section 5.

| PROBLEM FORMULATION
This work is performed on a microgrid system including wind energy, photovoltaic, base loads, and EVs, as illustrated in Figure 1, where the transmission line connects the microgrid with the utility. Nonlinear objective functions are subjected to the system's constraints to find the optimal capacity and location of photovoltaic and wind power stations with charging stations. The aim is to minimize voltage deviation, ENS and cost of power generated from the station, power loss, the cost of building renewable stations, and the cost of charging EVs.

| Objective function
The objective function is formulated as a weighted sum of all three objectives: The A, B, and C are the weighting coefficients that have been selected to be 0.25, 0.25, and 0.5, respectively. These coefficients are adjusted according to the importance of the objective functions. Each function is normalized by dividing by the base value. Note that f 1 is the total voltage deviation at each bus for 24 h, which is expressed by: Where Nbus is the number of buses, V i t , is the magnitude of the voltage at each bus at a specific time. In turn, f 2 is the total ENS, which is formulated as:

 
where P DG i t , is the active generated power from RER S on bus i at time t, P d i t , is the active power demand, PW w i t , , is the generated power from the wind turbine, PPV pv i t , , is output power from the photovoltaic panel at a specific time, N PWT . i is the number of wind turbine stations at bus i and N PV . i is the number of photovoltaic stations. P loss t , is total power loss at a specific time, G ij is the Conductance between bus i and j, and δ i t , is the angle of the voltage at a specific bus. The output power from a wind turbine can be calculated as a function of wind speed as follows: where P r i is rated power from the turbine at bus i where V i t , , V ci , V V , r co are the wind speed time t, cut-in speed, rated speed, and cut-out speed, respectively. The output power of photovoltaic units can be calculated as a function of solar irradiance, where P sr i is rated power from the photovoltaic panels at bus i, G std is global irradiance, about 1000 W/m 2 , G s t , is solar irradiance at each specific time, X c is specific irradiance point set to be 120 W/m 2 . 26 The third objective, that is, f 3 , is the total cost, which is formulated as follows: where c m is the cost of purchasing power from the market, n EV is the number of vehicles at each time interval, P sub t , is the generated power from the main substation as given in Equation (9). In this paper, EVs are modeled as active power sources during discharging and controllable loads during charging. 27 Equation (10) expresses the EV charging cost while Equation (11) represents the revenue obtained by EV owners for discharging during on-peak, where the discharging energy price c m DC − is more than a normal tariff c m to motivate the EV owners for discharging.
The total investment cost (CI DG ) of DG units can be expressed by: The annual installment (AI DG ) that must be paid by the utilities on the money invested for renewable energy station installation can be expressed as follows: Where CRF is the annual loan payment on the borrowed amount for N years at the rate of interest i rt , where N was taken as 20 and i rt taken as 10%. 28 Annual operation and maintenance of DG unit cost (OM DG ) is expressed by:

| Inequality constraints
The voltage at each bus for a specific time V i t , is limited by the minimum voltage V min and maximum voltage V max as in Equation (16). Discharging and charging rates are limited by the minimum discharging and charging P dc,min and P ch,min and maximum charging and discharging are limited by P dc,max , P , respectively ch,max , as in Equations (17) and (18). The number of EVs n Ev t , is limited to the minimum value n min and maximum value n max as in Equation (19), the current between bus i and j is limited by the maximum current as in Equation (20).

| Equality constraints
Power flow must achieve that the active P ( ) generated powers should be equal to the load demand and line losses between bus i and j at time t, where P ev i t , is the total power consumed or injected at bus i by the EVs, B ij is Susceptance between bus i and j, and Q d i t , is demand reactive power.

| JELLYFISH SEARCH OPTIMIZER
The oceans have several types of jellyfishes in different shapes, sizes, and colors. The jellyfish has the unique feature of hunting and the motion for food searching. Some jellyfish collect their food from oceans' current, and some jellyfish use their tentacles. The jellyfish are collected in swarms based on some factors such as temperature, oxygen availability, and the available nutrients. The jellyfish move in a swarm or follow the ocean's current for looking the food, and these jellyfish can also jump or switch from these motions. JSO mimics the motions of the jellyfish in oceans, which can be mathematically modeled as follows:

| The ocean current
As mentioned before, the jellyfishes move with ocean current, depending on abundant nutrients. The direction of the ocean current (Trend) is assigned by averaging all the vectors from each jellyfish in the ocean to the jellyfish that is currently in the best position, which can be represented as follows: where X best denotes the best location, n Pop represents a number of jellyfish, e c is a parameter for governing the attraction, μ represents the mean value of all jellyfish locations, and df reparents the difference between the best solution and the mean of the jellyfish, and R is a random value between 0 and 1.
By substituting df from Equation (26) into Equation (25) The new location of the jellyfish can be found as follows: By substituting TR from Equation (27) in Equation (28).

| The jellyfish swarm
The motions of the jellyfishes inside the swarm are divided into passive motion (type A) and active motion (type B). The jellyfish move according to type A at the beginning of the swarm formation, while the jellyfish move according to type B at the final stage. In passive motion, the jellyfish move randomly as follows: where L b and U b are the minimum and maximum limits of the variables. γ represents a motion factor. To illustrate the active motion, two jellyfishes (p, q) are chosen, where  p q. The jellyfish p moves to jellyfish q when the availability of foods is high while it moves away when the availability of the food is low. The active motion (type B motion) is represented as follows:

| Time control mechanism
The jellyfish changes its motion between the three motions. The transmission is assigned by the time control function (c), which is given as follows: where the c t ( ) is varied between 0 and 1, where this value is compared with C = 0.5 0 . When the c t ( ) is more than C 0 , the jellyfishes move in the swarm, but the jellyfishes follow the ocean current. It is worth mentioning here that the initial locations of the jellyfish are generated in a random manner using the chaotic logistic map as follows: where ξ denotes a random value generated within the range [0-1]. μ = 4, and ξ′ denotes the logistic chaotic value, where  ξ′ {0.0, 0.25, 0.75, 0.5, 1.0} . The flow chart of the JSO application for optimal allocation of charging stations and RERs as shown in Figure 2. To verify the effectiveness of the proposed algorithm, the obtained results by the JSO have been compared with other algorithms, including PSO, 29 ALO, 30 and SCA. 31 The selected parameters of JSO, PSO, ALO, and SCA are listed in Table 1.
The system under the study of IEEE 118-bus system, where this network is divided into four multi-microgrids as depicted in Figure 3.
The system parameters are depicted in Table 2, while The technical limits are provided in Table 3. 32 Each area of the multi-microgrid has a single charging station, PV unit, and wind turbine. Area 1 includes buses from (1-26), Area 2 includes buses from (27-61), area 3 includes buses from (62-98), and area 4 includes buses from (99-117).

| SIMULATION RESULTS
This section develops the proposed algorithm to assign the optimal locations and sizing of the charging stations and RERs, including the solar PV and wind turbine-based DGs in a multi-microgrid. The objective function is a multiobjective function that comprises (1) the total annual cost, (2) the summation of voltage deviations, and (3) ENS. The load profile and the network electricity price for a day head are shown in Figures 4 and 5, respectively. 27 The investment cost of PV and wind turbines is 770 and 4000$/kW, respectively, while the maintenance and operation cost of solar energy and wind energy are 0.01$/kW. 28 The solar irradiance 27 and wind speed 33 are shown in Figures 6 and 7, respectively. The cut-in speed, rated speed, and cut-out speed are 4, 17, and 25 m/s, respectively. 33 The performance of the proposed method was evaluated in MATLAB 2016 by core I5 CPU 2.2 GHz, 8 GB RAM.

| Base case
Without integration of RERs and charging stations, the system power loss cost is 1069,000$, the cost of power purchased from the grid is 27,886,000$, and the total cost is 28,955,000$. The summation of voltage deviations for the whole day is 94.0994 V, and the load factor is 0.7781. In this paper, an investigation has been proposed to study the performance and the impact of the installation of the charging stations and RERs as follows.

| Case 1
The charging stations were assigned without RERs, the EVs charged only during the off-peak time with a controllable charging strategy, and the numbers of EVs in the charging stations were assigned optimally during the charging period. Table 4 shows the Optimal sites and sizes of the charging stations and the number of EVs. As depicted in Table 5, compared to the base case, the total cost is 98.04%, the VD is 99.9%, the ENS is 97.98%, the total energy cost from the grid is 98%, and the cost of power loss is 99.1%. As a result, optimal powers flow, where EVs' placement and charging rate were optimally assigned. The system's voltage profile is shown in Figure 8. The total cost of power purchased from the grid, the total energy consumed by charging stations, and the cost of power loss are shown in Figures 9,10A, and 11, respectively.

| Case2
The charging stations with RERs were integrated optimally into the system. The EVs will charge only during the off-peak time with controllable charging strategy. The optimal locations and sizing of the charging stations and RERs are listed in Table 4, where the sizing of charging stations increased compared to case 1. In Table 5, compared to case 1, the VD, the ENS, and the total cost were reduced by 70.93%, 35.29%, and 7.5%, respectively. Also, the cost of power purchased from the grid power was reduced by 34.37%, as shown in Figure 9. The charging rate, in this case, is faster than in the previous case because of the installation of RERs, as shown in Figure 10B compared to Figure 10A. The cost of power loss was reduced by 18.085%, as shown in Figure 11. The minimum voltage magnitude of the system increased by 3.93% compared to case 1. Figure 12 shows the system voltage profile; according to this figure, the voltage profile was enhanced compared to case 1, which verifies the effectiveness of the RERs along with the charging stations.   The optimal locations and sizing of charging stations and RERs were assigned. The EVs were charged only during the off-peak time and discharged optimally during the on-peak time. The optimal locations and sizing of the charging stations and RERs are listed in Table 4, where the sizing of charging stations increased compared to case 2. As depicted in Table 5, compared to case 2, the VD, ENS, and total cost were reduced by 10.36%, 21.813%, and 22.29%, respectively, which verifies the effectiveness of RERs with a controllable charging and discharging strategy. Note that EVs acted as a power source during on-peak, as shown in Figure 10B.
As shown in Table 5, compared to case 2, the overall sizing of RERs was reduced by 13.22%, resulting in an 18.11% reduction in the annual investment cost of RERs.
The revenue from discharging EVs was 712,118$, so the charging cost was reduced. Furthermore, as shown in Figure 9, the total cost of purchasing power was reduced by 23.49%. The cost of power loss was reduced by 3.22%, as shown in Figure 11, and the minimum voltage magnitude was enhanced by 0.36%, as shown in Figure 13.
The load factor was increased to 85.67%, as shown in Table 5. As a result, compared to cases 1 and 2, the maximum load was the lowest, so the cost of reserving maximum power in main stations in case 3, as shown in Figure 14, was the lowest.

| Comparison of simulation result by various optimization techniques
To investigate the effectiveness of JSO, we compared JSO with PSO, ALO, and SCA in mentioned studied cases as follows.

| Case 1
JSO has obtained the minimum value of the objective functions, as depicted in Figure 15, Table 6, and Table 7 as well as the maximum total number of EVs, which verify the effectiveness of the proposed algorithm.

| Case 1
JSO has obtained the minimum value of the objective functions, as depicted in Figure 16, Table 8, and

| Case 3
Compared to case 2, as shown in Tables 9 and 10, voltage deviation increased by using PSO, ALO, and SCA. Also, the capital cost of RERs increased. However, JSO decreased the Voltage deviation and capital cost of RERs, which reinforces the effect of V2G in reducing the overall cost of the system. JSO has obtained the minimum value of the objective functions, as depicted in Figure 17, and Table 11.

| CONCLUSIONS
This paper proposed an efficient approach for integrating a large number of EV charging stations and RERs for reducing the waiting queues, power loss, voltage deviations, and the total annual cost of EV charging stations and RERs. An efficient optimizer called JSO was implemented for solving the allocation problem of EV charging stations and RERs in multi-microgrids. Different scenarios have been investigated including optimal integration of EV charging F I G U R E 17 Convergence curves by various algorithms during case 3. ALO, ant lion optimization; JSO, jellyfish search optimizer; PSO, particle swarm optimization; SCA, sine cosine algorithm stations without RERs, optimal integration of EV charging stations and RERs with a controlled charging strategy and optimal integration of EV charging stations and RERs with controlled charging and discharging strategy. The simulation result reveals that superior results are obtained in the case of optimal integration EV charging stations and RERs with controlled charging and discharging strategy, where VD, ENS, and total cost have been reduced considerably by 73.97%, 50.43%, and 29.55%, respectively, compared to the base case. In addition, the proposed optimizer is superior for solving the allocation problem of EV charging stations and RERs compared to the other well-known algorithms.
NOMENCLATURE RER renewable energy resource EV electric vehicle JSO jellyfish search optimizer PSO particle swarm optimization ALO ant lion optimization SCA sine cosine algorithm VD voltage deviation ENS energy not supplied P DG i,t active generated power hourly from renewable energy resources at bus i V i,t voltage magnitude hourly at bus i P d i,t load active power hourly at bus i P sub,t active generated power hourly from substation PW w,i,t active generated power hourly from wind station at bus i P r rated power of wind turbine V i,t wind speed hourly V ci cut-in speed V r rated speed V co cut-out speed PPV pv i t , , active generated power hourly from photovoltaic units at bus i P sr i rated power from the photovoltaic G std global irradiance G s t , solar irradiance at each specific time n EV number of electric vehicles P ch i k t , , active power charging capacity of EV P dh i k t , , active power discharging capacity of EV c m market price of electricity I C DG the total investment cost AI DG the annual installment CRF is the annual loan payment Q G i t , reactive generated power at bus i Q d i t , load reactive power hourly at bus i P ch min /P ch max min/max active power charging capacity of EV P dh min /P dh max min/max active power discharging capacity of EV V min /V max min/max voltage magnitude X t ( ) P current position of jellyfish X best best position of jellyfish Abbreviations: ALO, ant lion optimization; JSO, jellyfish search optimizer; PSO, particle swarm optimization; SCA, sine cosine algorithm.