Optimal Placement of Electric Vehicle Charging Stations in an Active Distribution Grid with Photovoltaic and Battery Energy Storage System Integration

: This article presents the optimal placement of electric vehicle (EV) charging stations in an active integrated distribution grid with photovoltaic and battery energy storage systems (BESS), respectively. The increase in the population has enabled people to switch to EVs because the market price for gas-powered cars is shrinking. The fast spread of EVs depends solely on the rapid and coordinated growth of electric vehicle charging stations (EVCSs). Since EVCSs can cause power losses and voltage variations outside the permissible limits, their integration into the current distribution grid can be characterized by the growing penetration of randomly dispersed photovoltaic (PV) and battery energy storage (BESS) systems, which is complicated. This study used genetic algorithm (GA) optimization and load ﬂow (accommodation of anticipated rise in the number of electric cars on the road) analysis with a forward and backward sweep methodology (FBSM) to locate, scale and optimize EVCSs from a distribution grid where distributed PV/BESSs are prevalent. Power optimization was demonstrated to be the objective issue, which included minimizing active and reactive power losses. To verify the proposed optimal objective solutions from the active distribution grid, an IEEE 33 bus distribution grid was considered for EVCSs’ optimization under the penetration of photovoltaic and BESS systems. MATLAB simulations for the integrated EVCS-PV-BESS system on the distribution grid for ﬁve different zones were performed using detection from zone 1 (ranging from 301.9726 kW to 203.3872 kW), reducing the power losses (accounting for 33%) in the system to a minimum level.


Introduction
As a result of their zero emissions on the road and clean power sources, electric vehicles (EVs) are becoming more popular around the globe.As the costs of photovoltaic modules and supporting equipment decreases, their widespread adoption is becoming more common in many nations [1].Prosumers, known as those who generate and consume energy at the same time, emerged as a result of the proliferation of photovoltaic (PV) systems and other distributed generation (DG) technologies [2].In addition to its environmental benefits as a "green energy", PV technology has shown its importance in the electrical distribution grid through its ability to minimize power losses and enhance the grid voltage Energies 2023, 16, 7628 2 of 26 profile [3].PV systems result in reduced electricity bills being paid to the utility company by consumers.This means lower utility bills for end users.However, the dramatic spread of electric vehicles (EVs) in the transport sector and combination of this technology and DGs offer the most promising option to lessen reliance on fossil fuels and lower greenhouse gas (GHG) emissions [4].As a result of the increasing popularity of EVs and the continuing depletion of crude oil, the outlook for petroleum-based cars worldwide is gloomy [5].In addition to being completely emission-free, electric vehicles provide several benefits, including noise pollution reductions (silence) and reduced fuel consumption [6].
For the reasons above, strategic EV charging station planning is becoming more critical.As the demand for electricity rises due to the incorporation of EVs, examining these vehicles' effects on the power grid is crucial.The literature shows that adding only 10% of EVs to a distribution network system raised peak demand by 17.9%, while adding 20% increased it by 35.8% [7].The effect of plug-in hybrid electric vehicles (PHEVs) on grid demand was investigated and examined in [8], including EV load measurements.Electric vehicles created higher peak demands, which in turn caused an increase in power losses and voltage fluctuations.As a result, this may lead to overheating in the transformer and the line itself [9].Losses in the distribution system were reduced from a coordinated billing strategy, as suggested in the EV load model employed for the calculations.In [10], it was shown that a smooth voltage profile was achieved with synchronized charging, while power losses were also reduced.Furthermore, this may keep the power grid from being overloaded.Although the methods proposed in the literature could improve the power losses and the voltage profiles in the power system with the integration of the EVs, the impacts of the high penetration of PV and BESSs were not considered.Moreover, the optimal solutions to minimize the power losses and maximize the voltage stability were not investigated.
The optimal placement of EV charging stations uses various methods, each with their own goals.Charging station placement may be improved by employing electric vehicles as a spinning reserve to provide peak demand and boost system performance.Thus, EVs may aid in minimizing costs and optimizing crucial parameters like voltage deviation and loss [11].Particle swarm optimization was utilized to obtain the optimal locations for charging stations [12].The authors of [13] accounted for carbon dioxide emissions in the design of EV charging stations.In [14], the K-means clustering approach was used to maximize a parking lot owner's profit by maximizing the interactions between parking lots.
Additionally, strategically placing charging stations in parking lots reduced power loss and voltage fluctuations while maximizing grid dependability.An intriguing strategy presented in [15] involved minimizing the unfavorable consequences of the widespread use of photovoltaics and the electric vehicle charging infrastructure by adjusting the location and size of these facilities.Similarly, solar photovoltaic generation's capacity to enhance the voltage profile was used to mitigate the unintended consequences of EV parking [16].
Considering factors such as drivers, operators, cars, the power grid, and traffic flow, the authors of [17] suggested a technique for finding the best possible locations for EV fast-charging stations.Figure 1 shows a schematic of a PV system used to charge electric vehicles at charging station hubs, demonstrating the massive installed power based on high-power chargers that place a high demand on grid infrastructure.Therefore, some stations use BESSs with local PV production to reduce peak power and consumption.A PV system with a BESS configuration was investigated in [18].Models were developed mathematically to predict how much electricity would be needed to charge electric vehicles (EVs) and how much could be produced from renewable sources like PV systems [19].
Many studies have focused on two major concerns with photovoltaic, battery energy storage, and EVCS systems (PBESs): size and energy management.Using a real-time power pricing scheme, Ref. [20] established an optimization methodology to install the BESS to decrease the operational cost of PV EVCSs.To determine the optimal sizes of the PV and BESS for a PBES linked to the grid, Ref. [21] proposed an optimization model based on particle swarm optimization (PSO) with a financial model as the primary objective that examined the factors that went into designing an EV fast-charging station, such as the Energies 2023, 16, 7628 3 of 26 number of chargers, the installed power of renewable energies, the installed power of energy storage, and the contractual power with the grid [22].A genetic algorithm was applied to resolve the optimization model, and the power consumption of EVs was simulated using the Er-lang B queuing model.To optimize the net present value, Ref. [23] used an operator to find the optimal charging nodes, PV capacity, and ESS size for a PBES.Best practices for installing a PV system for a standalone PBES were determined using a genetic algorithm.To maximize the power system efficiency with a PBES, the BESS and the grid are designed and controlled by using an energy management system [24].To coordinate EVs' charging and discharge schedules in a PBES, Ref. [25] adopted a mixed-integer linear programming (MILP) model.The ideal configuration of an EVCS using several energy sources was discovered by Hafez and Bhattacharya [26].To reduce yearly energy losses, reduce actual power losses, and enhance the voltage profile, Ref. [27] investigated the best way to integrate DG with shunt capacitors on the distribution grid.To reduce power loss and voltage fluctuations, the ideal DG and capacitor bank placement in the traditional distribution system was provided by [28].Power loss, voltage profile, and distribution grid stability were all factors that may be affected by DG and capacitor banks; these effects were examined in [29].Huy et al. [30] proposed a comprehensive multiple-objective hybridinteger linear programmer sample for an energy management system model at home, which uses vehicle-home and home-grid potential configurations by optimizing the cost of electricity, maximum to average power-load ratio, and index of discomfort.Any challenges relating to energy management systems at home were addressed effectively through the incorporation of ε-constraint augmentation with lexicographical optimization.
Energies 2023, 16, x FOR PEER REVIEW mathematically to predict how much electricity would be needed to charge elect cles (EVs) and how much could be produced from renewable sources like PV syste Many studies have focused on two major concerns with photovoltaic, battery storage, and EVCS systems (PBESs): size and energy management.Using a r power pricing scheme, Ref. [20] established an optimization methodology to in BESS to decrease the operational cost of PV EVCSs.To determine the optimal siz PV and BESS for a PBES linked to the grid, Ref. [21] proposed an optimizatio based on particle swarm optimization (PSO) with a financial model as the primar tive that examined the factors that went into designing an EV fast-charging stati as the number of chargers, the installed power of renewable energies, the installe of energy storage, and the contractual power with the grid [22].A genetic algorit applied to resolve the optimization model, and the power consumption of EVs w lated using the Er-lang B queuing model.To optimize the net present value, Ref. [ an operator to find the optimal charging nodes, PV capacity, and ESS size for a PB practices for installing a PV system for a standalone PBES were determined using a algorithm.To maximize the power system efficiency with a PBES, the BESS and However, as demonstrated in the literature, the penetration that PV and BESS integration achieved with an EVCS installation was not investigated, resulting in coordinated operations in the active distribution grid.Furthermore, the voltage stability index of the power system associated with the power losses was also not carried out.Nouri et al. [31] presented a novel developmental controller of an intelligent fuzzy logic system channeled to seamlessly manage the configuration of electric vehicle-grid and grid-electric vehicle operations.The intelligent fuzzy logic system controls different system variables such as energy production and demand fluctuation, charging state, and the time of parking the vehicles, respectively.The response of the system with and absence of electric vehicle batteries was compared, and an assessment of their impact on energy flow efficiency was demonstrated using the electric vehicle-grid station's needs.Bibak and Bai [32] proposed a novel optimization of an electric vehicle-battery-solar operational schedule activity model to supervise different sources of energy and application.The model was tested with an electrical system as a case study comprising solar photovoltaic panels, an electric vehicle battery re-use system, and a campus electrical shuttle in a fleet from a Turkish university that was subjected to charging demands.It was indicated that the obtained computational result from the integrated system where the optimization activity was coupled with the scheduled solution was able to reduce the net cost of electricity beyond 5% and upgrade the maximum-average ratio to 4%.Allouhi and Rehman [33] analyzed the feasible hybrid option of renewable energy systems in supermarkets with respect to the billing scheme considered in Morocco for medium-voltage facilities with an electric charger station design proposal for electric vehicles of a small size powered by the hybrid optional system.Al-Nahid et al. [34] proposed a valley-filling electric vehicle charging-based scheme for energy demand in residential areas, which was facilitated by a central charging network system.The network charging scheme comprises a genetic algorithm optimizer for accepting the electric vehicles and uses the best form of energy supplied from the available network.The charging scheme included electric vehicle-grid facilities and reallocation techniques for electric vehicle shifting in order to resolve any charging overload issues.Metwly et al. [35] employed a hierarchy controller scheme to compare the level of the charging station controller and the novelty control level of the electric vehicle by adopting a multi-objective optimizer method for the optimal electric vehicle charging-discharging rates, utilizing a searching pattern algorithm.Hassan et al. [36] conducted a feasibility analysis of a hybrid renewable energy-electric vehicle charging network station architecture with multipleobjectivity techno-economics and atmospheric indications (levelized energy cost, emissions from carbon and net present cost values) in relation to a planned sustainable approach for optimizing renewable energy system-electric vehicle charging networks powered within the premises of institutions.Liu et al. [37] proposed and developed a transient network (energy) design with a management model that was integrated with solar photovoltaic panels on the rooftop, static storage (battery) systems, and electric vehicles to operate a net-zero network (energy) for an office building.The flexible grid power flow was maintained by the utility grid-protection network (energy) strategic management scheme, with an evaluation proposal indicator being used for periodic applications covering the flexible grid peak factor, valley and flat periods (hours), respectively.Datta and Das [38] developed a new double-level framework for a managing-energy system with a hybrid microgrid system component (industrial, commercial and residential microgrids).The microgrids encompass the distribution grids (dispatchable), hybrid renewable sources (wind and solar distribution generation) and batteries-plug-in-electric vehicles, respectively.The energy management scheme of the hybrid microgrid network involved a scheduled strategic plan for the distribution resources, hybrid renewable system and penetration of plug-in-electric vehicles to boost the environmental-economic benefits of the entire network.Amar Kumar Barik [39] presents a comprehensive assessment of the optimal resource allocation for eco-friendly and sustainable-energy-based hybrid microgrids with distributed generation.The research addresses challenges related to the intermittency of renewable resources and the low inertia of microgrids through the coordination of demand-response support (DRS) and virtual-inertia support (VIS) systems.The study focuses on planning three distributed microgrids integrating locally available solar, wind, and bioenergy resources alongside combined storage-based VIS and electric vehicle charging-station-based DRS units for effective supply-and demand-side management.The planned system, modeled and simulated in MATLAB using real-time recorded solar/wind data over 12 months, explores various scenarios of source and load variations.Controllers are fine-tuned using the innovative quasi-oppositional chaotic selfish-herd optimization (QCSHO) algorithm, demonstrating its superiority over other contemporary algorithms based on system responses.
The various works carried out by different researchers are summarized in Table 1.

Novel Strategy
An optimization model for dimensioning PV and BESSs is developed, considering dynamic and grid-connected environments.The proposed objective optimizations for minimizing the power losses and maximizing the voltage stability index are considered in this paper to obtain the optimal location of the EVCSs with the penetration of PV and BESS in the active distribution grid.The results of applying this strategy to IEEE 33 bus testbed distribution systems show that the proposed method's performance in finding the best solutions to install EVCS units in the distribution grid is both valid and effective.
The objectives listed below are some of this paper's most significant contributions: 1.
To achieve fast and accurate convergence through a combination of analytical search strategies and heuristics.2.
To further reduce distribution grid losses, it is important to consider how the active power flow on the slack bus depends on the active power produced by PV and BESSs.3.
To maximize the power system stability by minimizing power loss and optimizing active power, power factor, and location for EVCS.4.
To analysis the issue of reducing power losses using PV and BESS integration for optimal output active power in terms of power distribution loss coefficients and voltage stability index.
This paper is composed as follows: Section 2 presents the active power distribution grid.The optimization techniques are described in the theory and general equations in Section 3. Section 4 shows the mathematical formulations of active distribution networks used in the proposed methodology.The optimal location and sizing using GA are presented in Section 5. Section 6 presents the results, confirming the proposed method.Finally, the discussion and conclusion are provided in Section 7.

The Definition of Active Power Distribution Grid
The escalating global energy demand over the past two decades has spurred concerns about energy security and adequacy.Addressing these challenges is essential for achieving sustainable development goals.Energy resource planning, encompassing strategic management, control, and energy supply storage, plays a pivotal role in the global economy and geopolitics of clean energy.The integration of microgrids adds a crucial layer to the advantages of renewables, enhancing system performance and reducing energy losses.The potential of energy resource management is amplified by the benefits offered by hybrid microgrids.These systems, combining various energy sources and storage solutions, present a promising avenue for addressing the complexities of modern energy needs.Research efforts have delved into overcoming challenges related to voltage and frequency regulations, low-inertia issues, demand-response mechanisms, the seamless integration of renewable systems, and the optimization of controllers using metaheuristic techniques.
In Figure 2, active power distribution network refers to an electrical power distribution system that can actively control and manage the flow of electricity from the point of generation to the end of consumption.Traditionally, power distribution systems operate passively, with electricity flowing from the power plant to consumers without active control.However, active power distribution grids have become more critical with the increasing use of renewable energy sources and the need to manage electricity demand.
Energies 2023, 16, x FOR PEER REVIEW Overall, an active power distribution grid is an advanced and modern distribution system that is capable of actively managing and optimizing distribution, enabling more efficient and sustainable energy use [41].

Voltage Stability Analysis
In the study of power distribution, three types of static analysis can determine the power grid's reliability.These methods (power flow, Q -V CPF) are used to gauge the reliability of the grid's voltage.An active power distribution grid can use various technologies and techniques to manage the flow of electricity, including advanced metering infrastructure, real-time monitoring and control, and smart grid technologies.By actively managing electricity distribution, an active power distribution grid can help increase the power grid's efficiency and reliability, reduce energy consumption, and enable the integration of a high amount of renewable energy sources [40].
Overall, an active power distribution grid is an advanced and modernized power distribution system that is capable of actively managing and optimizing electricity distribution, enabling more efficient and sustainable energy use [41].

Voltage Stability Analysis
In the study of power distribution, three types of static analysis can be used to determine the power grid's reliability.These methods (power flow, Q-V curve, and CPF) are used to gauge the reliability of the grid's voltage.
The power flow analysis is used as a static analysis in the electric utility business to determine the reliability of the voltage supply.The power flow can be evaluated by analyzing the bus voltage or other designated terminals and the power flow across the transmission line.In terms of the admittance matrices on the bus, the system equations are given by Equation ( 1): Y represents admission, b represents bus number, and n represents the number of buses.The voltage, current, and reactive power at a given bus may all be calculated, as shown in Equation ( 2): where P is active power and Q is reactive power.
where G is conductance, B is susceptance, and Y = G ± jB.Then, the active and reactive power s at each bus is the function of voltage magnitude, and the phase angle becomes: where θ bm is the phase from bus to bus and is equal to θ b − θ m .Q-V model analysis, the voltage is completely related to the reactive power, assuming that the active power is constant at every operating point.The stability of the voltage can then be calculated via the incremental relationship between reactive power and voltage.The reduced Jacobian matrix can be shown in Equation ( 6): Furthermore, the Jacobian matrix can be factored in Equation (7): where x is the right eigenvector matrix of the Jacobian matrix, is the diagonal eigenvector matrix of the Jacobian matrix, and η is the left eigenvector matrix of the Jacobian matrix.
The voltage variation against the reactive power is shown in Equations ( 8) and ( 9): where x i is the i − th column of the right eigenvalue of the Jacobian matrix, η i is the i − th row of the left eigenvalue of the Jacobian matrix, and i is the i − th eigenvalue of the Jacobian matrix obtained from the diagonal matrix (Λ −1 ).The voltage deviation for the i − th mode is shown in Equation ( 10): The eigenvalues of the Jacobian matrix can serve as an indicator of the system's voltage stability.The grid is stable when all the eigenvalues have positive values, or the grid is unstable when the minimum eigenvalue is equal to zero or less than zero.Therefore, the lower the value of the positive eigenvalue, the nearer the system is to voltage instability.The V − Q sensitivity at b bus is shown in Equation (11): A negative Q-V sensitivity means that the grid is unstable.This implies that a lower sensitivity means a more stable grid.To determine the relationship between the system buses and each eigenvalue, the participation factor (PF) becomes the formula, as shown in Equation ( 12):

Typical PV Panel
The quantity of PV panels used in the PBES PV system design is based on the PV system's expected power production and the system's expected load.Equation (13) outlines the relationship between the cell temperature, solar radiation intensity, panel area, and absorption capacity, all of which affect the PV panel's power production [42].
where G t (t) represents the solar radiation hitting the PV panel perpendicularly at a given time; G re f is 1000 W/m 2 ; P PV−STC represents the PV panel's rated power under standard test conditions (STC); η PV represents the efficiency of the PV panel's; T C−STC is the reference temperature of 25 • C; β T is the temperature coefficient between 0.004 and 0.006 per • C; T C represents the cell temperature.
The cell temperature T C may be calculated by using Equation ( 14): where T amb is the temperature outside and NOCT is the temperature inside a typical laboratory cell.

Modelling of Photovoltaic System
Solar energy is converted into electrical energy by photovoltaic systems [43].Their output is DC power, which is converted to AC power by an inverter to make it compatible with the AC grid.The power output of a solar photovoltaic (PV) panel β is determined by the PV panel's size (A), solar irradiance µ(t), and efficiency, as shown in Equation (15).
Energies 2023, 16, 7628 The static electronic converter converts solar energy to power grids; in normal operation, it acts primarily as a generator with a constant power factor.As a result, it was modeled as a constant power factor model.The maximum power rating of a solar photovoltaic station is determined by calculating the average total daytime solar power using Equation (15).Solar power is determined using the average power, predicted by irradiance.The data on sun irradiation throughout 24 h are shown in Table 2 using Equation (15).In this study, the solar panels provided an average of 1.191 p.u. of power [44].According to [45], the fundamental active and reactive powers of the loads are reported.However, at different parts of the day, the load profile is not reported.In order to construct a daily load profile, a time-based factor (HBFt) should be added to the base-load data.Figure 3 shows how this factor will be altered throughout the day to reflect the load profile during peak and off-peak periods, and the large-scale PV farm's anticipated daily average electricity output was also considered.However, in many situations, the load and power generation profiles can also be taken into account.The active P L i,t and reactive Q L i,t powers of the ith bus at the tth time step are determined as shown in Equations ( 16) and ( 17): where P L i,base and Q L i,base are the basal active and reactive powers, respectively.

Battery Energy Storage System (BESS)
The power-balanced electricity system (PBES) uses a battery bank as a storage dev to stabilize the grid's power supply and demand.As a result of using the suggest optimization model, the ideal BESS capacity and charging/discharging cycle may established.The energy stored in the BESS is mathematically formulated as shown Equation (18) for each period:

Battery Energy Storage System (BESS)
The power-balanced electricity system (PBES) uses a battery bank as a storage device to stabilize the grid's power supply and demand.As a result of using the suggested optimization model, the ideal BESS capacity and charging/discharging cycle may be established.The energy stored in the BESS is mathematically formulated as shown in Equation ( 18) for each period: where σ denotes the BESS's ability to discharge itself; P ch (t) is the charging power at time t, and P dis (t) is the discharging power at time t; η ch represents BESS's charging and discharging efficiencies, respectively.The period of operation is denoted by ∆t and T is the total number of periods.As shown in Equations ( 19)-( 21), the BESS cannot simultaneously perform operations on the charge and discharge states: ) where µ 1 (t) is the state of charge (SOC) of the BESS and µ 2 (t) is the depth of discharge (DOD) of the BESS.A value of one indicates that the BESS is charging or discharging, whereas zero indicates the reverse.
The above equation shows that keeping the energy levels in the BESS constant between the start and stop times is the best way to avoid energy buildup, as shown in Equation ( 22): Energies 2023, 16, 7628 11 of 26 However, the BESS cannot be charged or discharged faster than the manufacturer recommends, and there are limits on how much power may be drawn from it, as shown in Equations ( 23) and ( 24): P ch (t) ≤ P BESS (23) If PBESS is replaced with BESS's rated power, then we can obtain, as seen in an equation, a limit on the amount of energy that can be stored in a BESS, as shown in Equation ( 25): where E BESSmax and E BESSmin represent the highest and lowest battery energy storage limits.
The highest battery energy storage, E BESSmax , can be calculated as shown in Equation ( 26): where DOD is the maximum permissible discharge depth.

Definition of Optimization Technique
The ideal condition was found using an optimization method and a power flow study.Thus, the optimization method and the power flow analysis will be discussed separately in this section.The optimization approach solved the E condition problem by defining an objective function.According to the optimal function, it should minimize reactive power losses while improving voltage stability.The voltage-dependent power flow [46] for the EVCS was solved using a forward-backward sweep.Several problem-solving approaches, known as optimization methods and techniques, fall into two broad categories: singleobjective optimization and objective optimization.This allows for a wider scope for the optimization technique framework.These works use metaheuristic approaches to achieve their goals.Based on our research objectives, the metaheuristic genetic algorithm (GA) was used to complete this study.The size and placement considerations for EVCSs, PV systems, and BESSs were compared using GA.

Genetic Algorithm (GA)
The genetic algorithm in Figure 4 is an optimization algorithm inspired by the process of natural selection in biology.GAs are commonly used to solve optimization problems where the solution space is very large, complex, or difficult to evaluate using traditional optimization techniques [47].The basic idea behind GAs is to establish possible solutions to the optimization problem and then use operations like selection, mutation, and crossover to move the population toward a better solution.
GAs have been successfully applied to many optimization problems, including the optimization of complex systems, parameter-tuning of machine learning algorithms, and scheduling problems.

GA Implementation for the Optimal Placement and Size of EVCS, PV, and BESS
This study uses a genetic algorithm-based optimization technique to discover the ideal location and size of the EVCSs, PV systems, and BESSs by reducing losses and improving voltage.For each EVCS, PV system, and BESS, the basic GA has a chromosomal size of 20 bits.This study utilized a population size of 120, an elitism operator of 0.1, a crossover probability of 0.7, and a mutation probability of 0.005.Figure 5 illustrates the development of a chromosome.

Genetic Algorithm (GA)
The genetic algorithm in Figure 4 is an optimization algorithm inspired by the process of natural selection in biology.GAs are commonly used to solve optimization problems where the solution space is very large, complex, or difficult to evaluate using traditional optimization techniques [47].The basic idea behind GAs is to establish possible solutions to the optimization problem and then use operations like selection, mutation, and crossover to move the population toward a better solution.GAs have been successfully applied to many optimization problems, including the optimization of complex systems, parameter-tuning of machine learning algorithms, and scheduling problems.

GA Implementation for the Optimal Placement and Size of EVCS, PV, and BESS
This study uses a genetic algorithm-based optimization technique to discover the ideal location and size of the EVCSs, PV systems, and BESSs by reducing losses and improving voltage.For each EVCS, PV system, and BESS, the basic GA has a chromosomal size of 20 bits.This study utilized a population size of 120, an elitism operator of 0.1, a crossover probability of 0.7, and a mutation probability of 0.005.Figure 5 illustrates the development of a chromosome.

Problem Definition
The following relationship, known as the Kron equation [48], allows for the expression of active power losses in the power grid as a function of the power generated by various units, as shown in Equation (27).
Equation ( 27) can be written using a matrix notation, as shown in Equation (28).
Equation (28) shows the formula for the extinction coefficient matrix.These coefficients do not always remain constant.Instead, they are typically a function of the values of both the generator and the load.In contrast, one must use the basic approach to working the system to generate these coefficient matrices.
The following hypothesis is advanced and supported by the data in this investigation: electrical distribution grid use of information derived from the IEEE 33 bus grid concept.The Slack bus, or bus 1 in IEEE 33 bus radial systems, provides electricity to

Mathematical Formation of Active Distribution Network 4.1. Problem Definition
The following relationship, known as the Kron equation [48], allows for the expression of active power losses in the power grid as a function of the power generated by various units, as shown in Equation (27).
Equation ( 27) can be written using a matrix notation, as shown in Equation (28).
P L = P T g BP g + P T g B 0 + B 00 (28) where , and P T g = [P 1 P 2 . . .P ng .Equation (28) shows the formula for the extinction coefficient matrix.These coefficients do not always remain constant.Instead, they are typically a function of the values of both the generator and the load.In contrast, one must use the basic approach to working the system to generate these coefficient matrices.
The following hypothesis is advanced and supported by the data in this investigation: electrical distribution grid use of information derived from the IEEE 33 bus grid concept.The Slack bus, or bus 1 in IEEE 33 bus radial systems, provides electricity to the generator via the distribution power grid.EVCS systems might benefit from power factor correction devices in terms of their performance and energy efficiency [49].

Optimal Sizing of EVCS, PV and BESS
It is anticipated that n g units of PV and BESSs are put in the buses k n1 , k n2 . ..k ng that operate with a constant power factor to achieve the best possible dimensioning of PV and BESSs.Assume that bus number 1 serves as the generating unit in Slack mode.There are n g + 1 generators in the network.The power losses in the network can be calculated using Equation (27).On buses 2, 3 n g +1, PV and BESSs are presumably fitted.
If the derivative of Equation ( 27) was zero, the power losses would be reduced to a minimum.One thing to keep in mind is that P 2 . ..P ng + 1 in Equation ( 29) depends on the power variables created by the Slack bus, P 1 , which provides the power generated by various PV and BESSs.
In a given power grid state, it is anticipated that P D would not change, which leads to the division of Equation (30): Since ∂P l /∂P i and ∂P D /∂P l are equal to zero, the formula for Equation (30) may also be written as shown in Equation (31): P 1 is determined by the amount of power produced by the various EVCS systems, as shown by Equation (31).However, the conversion of the ratio of the active power generated by the slack bus on bus number one to PV and BESS units is equal to −1, with minimal losses.The following illustrates how to reduce Equation ( 27) using the Lagrange relaxation method in Equation (29).
According to Equation ( 32), all individual partial functions should equal zero.
Then, the solution to Equation ( 34) may be expressed in matrix form as Equation ( 35): Energies 2023, 16, 7628 14 of 26 P can be calculated from Equation (35) using Equation ( 36): Equation ( 36), x, E, and F can be solved by first solving Equation ( 37), then solving Equations ( 38) and (39), respectively: The calculation for each component of P is shown in Equation ( 40): By entering Equation (36) to Equation ( 40) into Equation ( 29), the optimum P i for a given value of x may be computed in Equation (36).As a result, the following can be written: An extension of the results in Equation ( 41) is presented in Equation ( 42): where a, b, and c are the estimated constant in Equation ( 43): Equations ( 38) and ( 43) may be written as Equation ( 44): As B = BT, Equation ( 44) may be simplified by Equation ( 45): The formula can be used to calculate b in Equation ( 46): Equation ( 39) represents the calculation of the b coefficients using Equation ( 47): Finally, c can be computed as follows: The results of Equation ( 42) can be found in Equation ( 49): Because b is a negative value in Equation ( 47), x 1 has a high value and the related P i is also considerable in Equation ( 40).This value is unacceptable because the value P i is too large for each unit.
Therefore, the absolute equation is shown in Equation ( 50): The best P i is determined using Equations ( 40)-( 50).

Minimization of Total Power Loss
The total loss has a significant impact on all of the electricity generation.Two power systems are used to estimate the current flow in the lines between the buses of those systems.These currents result in energy loss P L , representing the most important objective function, which is mathematically modeled as shown in Equation (51): representing the total number of transmission lines in the system, the conductance of the line, the magnitude of the sending end voltage and receiving end voltage of the line, and the angle of the end voltage.

Improving the Voltage Stability Index
To achieve the quality needed in modern electrical systems, significant improvements in voltage stability are related to the power supply's ability to maintain an acceptable bus voltage.In both normal and increased usage conditions, this paper uses the voltage deviation index to estimate the voltage stability index.The equation is defined as shown in Equation ( 52): representing the number of buses, the reference voltage, and the voltage on the bus.Reducing the overall power loss of both components is one of the main concerns in the operation and control of the power system.The voltage stability index is less important than the power loss reduction; the weights of P L and VSI ( f 1 and f 2 ) are also considered to be 0.50 and 0.35, so the maximum and minimum values are possible.The change in each index due to the increasing PV and BESSs, along with the optimization problem, is shown in Equation ( 53):

EVCS Model
To that end, the EVs under consideration in this research adhere to the first of the above-mentioned possibilities.Therefore, the distribution power grid treats the EVCSs as loads (G2V), and this study does not take V2G into account.The IEEE 33 bus distribution grid is employed as the research infrastructure in this work.Figure 6 shows a broad, well-balanced distribution power grid operating at 12.66 kV and 100 MVA base values.The total system load is 3.802 MW and 2.334 MVA.The base case's real power loss of 33 bus systems is 225 kW, and the minimum bus voltage is 0.9092 p.u. [50].
To that end, the EVs under consideration in this research adhere to the first of the above-mentioned possibilities.Therefore, the distribution power grid treats the EVCSs as loads (G2V), and this study does not take V2G into account.The IEEE 33 bus distribution grid is employed as the research infrastructure in this work.Figure 6 shows a broad, wellbalanced distribution power grid operating at 12.66 kV and 100 MVA base values.The total system load is 3.802 MW and 2.334 MVA.The base case's real power loss of 33 bus systems is 225 kW, and the minimum bus voltage is 0.9092 p.u. [50].The ideal locations and capacities of the PV and BESS are determined by simultaneous optimization to maximize voltage and minimize loss, with the EVCS and PV index serving as the objective functions, respectively.MATPOWER and MATLAB were used for the power flow calculations.Therefore, a sufficient number of EV charging stations is needed.This being the case, as many EV chargers as possible should be placed in each "zone", but not so many that the supply grid is overloaded.The GA will ensure the full contribution of the PV and BESSs and ensure that they meet their potential.The project's key contribution will be the enhanced voltage profile and EV incorporation.

Optimal Location and Sizing Using GA
After executing the FBSM, which is based on Equation (27), in the distribution grid with the lowest losses, a value for the chromosomal fitness may be calculated, as shown in Equation (54): By adjusting the power factor and installation locations of different PV and BESSs, the GA should determine the fitness function value with the lowest fitness.The distribution grid with minimal power losses is established for the PV and BESS units that The ideal locations and capacities of the PV and BESS are determined by simultaneous optimization to maximize voltage and minimize loss, with the EVCS and PV index serving as the objective functions, respectively.MATPOWER and MATLAB were used for the power flow calculations.Therefore, a sufficient number of EV charging stations is needed.This being the case, as many EV chargers as possible should be placed in each "zone", but not so many that the supply grid is overloaded.The GA will ensure the full contribution of the PV and BESSs and ensure that they meet their potential.The project's key contribution will be the enhanced voltage profile and EV incorporation.

Optimal Location and Sizing Using GA
After executing the FBSM, which is based on Equation (27), in the distribution grid with the lowest losses, a value for the chromosomal fitness may be calculated, as shown in Equation (54): By adjusting the power factor and installation locations of different PV and BESSs, the GA should determine the fitness function value with the lowest fitness.The distribution grid with minimal power losses is established for the PV and BESS units that are suitable for installation.This research employs three criteria to determine the optimal use of the PV and BESS.These elements determine the actual power and position of the PV and BESS.A mathematical procedure and analytic answer determine power Equation (51).Location and power factors are used by the GA optimization method.They presume that the PV, BESS, and GA chromosomal lengths correspond to the power factor genes and PV and BESS's connecting locations.That is to say, the first step in the GA process is to generate a pool of potential solutions, also called scenarios or chromosomes.
The GA technique for determining the best site for distributed generation includes the following steps: Step 1: Data from input lines and buses and bus voltage restrictions are used.
Step 2: A backward-forward distribution load flow calculation is used to determine the damage.
Step 3: Initial population in the method is generated at random.
Step 4: The program generates a new generation or population from the existing members.
Step 5: The algorithm uses crossover and mutation processes on people within the current generation to generate new generations.
Step 6: The offspring of the future generation is substituted for that of the present generation.
Step 7: The highest fitness is rewarded with a spot at the table for the following generation.
Step 8: When one of the thresholds is reached, the algorithm exits.
Step 9: Repeating the first five steps, the GA algorithm selects parents, generates new solutions, and evaluates their fitness until a stopping criterion is met.
Step 10: A copy of the best answer to the given issue is produced.To minimize power loss, the optimal placement considers the optimal placement of the EVCS, PV, and BESS.

Simulation Results
The simulation results in Figure 7 on the IEEE 33 bus, which compared the normal case with the EVCS applied to the PV and BESS, show that, as expected, the PV and BESS only generate active power and neither generate nor utilize reactive power.This was determined by comparing the normal case with the EVCS applied to the PV and BESS.Depending on the grid segment, varying numbers of PV and BESS units will be deployed.Table 3 shows the results of the simulation. generation.
Step 8: When one of the thresholds is reached, the algorithm exits.
Step 9: Repeating the first five steps, the GA algorithm selects parents, generates new solutions, and evaluates their fitness until a stopping criterion is met.
Step 10: A copy of the best answer to the given issue is produced.To minimize power loss, the optimal placement considers the optimal placement of the EVCS, PV, and BESS.

Simulation Results
The simulation results in Figure 7 on the IEEE 33 bus, which compared the normal case with the EVCS applied to the PV and BESS, show that, as expected, the PV and BESS only generate active power and neither generate nor utilize reactive power.This was determined by comparing the normal case with the EVCS applied to the PV and BESS.Depending on the grid segment, varying numbers of PV and BESS units will be deployed.Table 3 shows the results of the simulation.The simulation results from the IEEE 33 bus test are shown in Table 3.The EVCS 200 kW installation was zoned with the optimal sizing and location of PV and BESS (bus 2 to bus 33), with a total voltage of 0.9448 p.u. and a total power loss of 301.9726 kW, and the results of the zoning simulation are as follows: In zone 1, the optimal EVCS position in bus 8, and the optimal PV position in bus 13 totaled 692.3567 kWp, and the optimal BESS position in bus 5 totaled 81.9386 kWh, with a total voltage of 0.9467 p.u. and a total power loss of 203.3872 kW.
In zone 2, the optimal EVCS position in bus 17, the optimal PV position in bus 29 totaled 295.2508 kWp, and the optimal BESS position in bus 5 totaled 45.6643 kWh, with a total voltage of 0.9994 p.u. and a total power loss of 210.1145 kW.
In zone 3, the optimal EVCS position in bus 21, the optimal PV position in bus 13 totaled 646.2517 kWp, and the optimal BESS position in bus 5 totaled 74.2527 kWh, with a total voltage of 0.9453 p.u. and a total power loss of 203.9012 kW.
In zone 4, the optimal EVCS position in bus 25, the optimal PV position in bus 13 totaled 658.7533 kWp, and the optimal BESS position in bus 5 totaled 76.6890 kWh, with a total voltage of 0.9476 p.u. and a total power loss of 206.0026 kW.
In zone 5, the optimal EVCS position in bus 30, the optimal PV position in bus 29 totaled 453.1764 kWp, and the optimal BESS position in bus 5 totaled 83.1685 kWh, with a total voltage of 0.9461 p.u. and a total power loss of 203.8362 kW.
A comparison of voltage levels for an IEEE 33 bus system with and without EVCSs, PV systems and BESSs being in installed bus voltages in the base box, and after the installation of EVCS, PV and BESS units, is shown in Figure 8.The results show that installing PV and BESS units greatly improved the voltage profile.Installing PV and BESS units will provide better average voltage levels (0.9733 p.u.) than legacy systems (0.9367 p.u.). Figure 9 presents the proposed solution method's performance and implementation highlighting a very important issue in EVCS planning.There are buses (the mos representative being bus number 2) where PV and BESS connection results in power losse increasing to values higher than the power losses before installing the PV and BESS.Thi is an effect exactly opposite to the one sought when searching for the PV and BESS' optimal allocations.Figure 9 presents the proposed solution method's performance and implementation, highlighting a very important issue in EVCS planning.There are buses (the most representative being bus number 2) where PV and BESS connection results in power losses increasing to values higher than the power losses before installing the PV and BESS.This is an effect exactly opposite to the one sought when searching for the PV and BESS's optimal allocations.
A comparison of load and line reactive power profiles was made to assess the impact of the power management scheme.In Figures 10 and 11, a change can be seen in the power factor.Voltage stability and overall system performance were used to evaluate whether the reactive power consumption was reduced or the power factor was improved.
Figure 9 presents the proposed solution method's performance and implementation highlighting a very important issue in EVCS planning.There are buses (the mos representative being bus number 2) where PV and BESS connection results in power losse increasing to values higher than the power losses before installing the PV and BESS.Thi is an effect exactly opposite to the one sought when searching for the PV and BESS' optimal allocations.A comparison of load and line reactive power profiles was made to assess the impac of the power management scheme.In Figures 10 and 11, a change can be seen in the powe factor.Voltage stability and overall system performance were used to evaluate whethe the reactive power consumption was reduced or the power factor was improved.When optimizing a system's or project's capacity in light of many criteria and goals, an appropriate capacity size may be found using GA, as shown in Figure 12.Whether a PV system, energy storage, power plant, or any other application, GA looks for the greatest capacity combination to meet specific goals while considering limits and performance criteria.Using GA, one may choose an effective and efficient capacity size that maximizes energy output, reduces costs, maximizes resource usage, or satisfies other project criteria.The GA algorithm assists in determining an ideal capacity size that complements the system's or project's targeted results and objectives.Convergence characteristics of various optimization techniques were used to achieve the best possible integration of four EVCS, PV, and BESS units into the distribution system, as shown in Figure 13, with over 100 iterations.The results of the optimization will come together quickly.Figure 10.Load reactive power profiles before and after the changes to the grid.When optimizing a system's or project's capacity in light of many criteria and goals an appropriate capacity size may be found using GA, as shown in Figure 12.Whether PV system, energy storage, power plant, or any other application, GA looks for th greatest capacity combination to meet specific goals while considering limits and performance criteria.Using GA, one may choose an effective and efficient capacity siz that maximizes energy output, reduces costs, maximizes resource usage, or satisfies othe project criteria.The GA algorithm assists in determining an ideal capacity size tha complements the system's or project's targeted results and objectives.Convergence characteristics of various optimization techniques were used to achieve the best possible integration of four EVCS, PV, and BESS units into the distribution system as shown in Figure 13, with over 100 iterations.The results of the optimization will come together quickly.This location-based method aims to guarantee effective coverage of EVs and accessible EV charging infrastructure throughout the nation.Authorities may identify the best places for an EVCS in each zone by examining traffic patterns, charging demand, and current charging infrastructure.This tactical move lessens range jitters, encourages eco-friendly mobility alternatives across the state, and supports the increased use of electric vehicles.Convergence characteristics of various optimization techniques were used to achieve the best possible integration of four EVCS, PV, and BESS units into the distribution system, as shown in Figure 13, with over 100 iterations.The results of the optimization will come together quickly.Figure 15 depicts the PV optimizer utilizing a 24 h timeframe and a genetic algorithm (GA) to determine the best times for the operation and scheduling of solar panel throughout the day.The system employs genetic algorithms to optimize energ generation from the PV system by considering variables like solar irradiance, weather and 24 h energy consumption patterns.It is essential to effectively utilize solar energy t satisfy energy demands and reduce dependence on non-renewable energy sources.Thi will help create a sustainable and ecologically friendly energy solution.Figure 15 depicts the PV optimizer utilizing a 24 h timeframe and a genetic algorithm (GA) to determine the best times for the operation and scheduling of solar panel throughout the day.The system employs genetic algorithms to optimize energy generation from the PV system by considering variables like solar irradiance, weather and 24 h energy consumption patterns.It is essential to effectively utilize solar energy to satisfy energy demands and reduce dependence on non-renewable energy sources.Thi will help create a sustainable and ecologically friendly energy solution.Figure 16 depicts the PV optimizer utilizing a 24 h timeframe and a genetic algorithm (GA) to determine the best times for the operation and scheduling of solar panels throughout the day.The system employs genetic algorithms to optimize energy generation from the PV system by considering variables like solar irradiance, weather, and 24 h energy consumption patterns.It is important to effectively utilize solar energy to satisfy energy demands and reduce dependence on non-renewable energy sources.This will help create a sustainable and ecologically friendly energy solution.Simulating the optimal location of electric vehicle charging stations (EVCSs) in th IEEE 33 bus distribution system involves using power system simulation software t analyze the distribution network and identify the best locations for placing chargin Simulating the optimal location of electric vehicle charging stations (EVCSs) in the IEEE 33 bus distribution system involves using power system simulation software to analyze the distribution network and identify the best locations for placing charging stations.The IEEE 33 bus system is a well-known benchmark distribution network for testing and research.We will discuss the steps and considerations involved in this simulation.Data Collection: Gather the necessary data for the IEEE 33 bus system, including network topology, load profiles, distribution transformers' capacity, line parameters, and substation locations.Load Modeling: Characterize the existing electrical loads in the network, including residential, commercial, and industrial loads.Integrate electric vehicle charging demand profiles based on charging power levels and dwell times.Charging Station Characteristics: Define the characteristics of the charging stations, such as their charging power levels (kW), number of charging points, and operating hours.Network Modeling: Create a detailed model of the IEEE 33 bus distribution system in the simulation software.Represent transformers, distribution lines, loads, and substation connections accurately.Optimal location analysis uses optimization algorithms within the simulation software to identify optimal locations for charging stations.Common optimization objectives include minimizing distribution losses, avoiding grid congestion, and maximizing the utilization of renewable energy sources.
Load Flow Analysis: Conduct load flow analyses to assess the impact of adding charging stations on voltage levels, line currents, and power losses.This analysis ensures that the new loads from charging stations do not violate network constraints.Renewable Energy Integration: If the IEEE 33 bus system includes renewable energy sources, such as solar panels, incorporate their generation profiles into the simulation.Determine how the charging station's placement affects the integration of renewable energy and the utilization of generated power.Grid Resilience and Reliability: Assess the impact of EV charging on grid resilience and reliability.Consider scenarios like unexpected load spikes and the distribution network's ability to handle them without causing disruptions.Economic Analysis: Estimate the costs associated with installing charging stations at different locations, including infrastructure upgrades if required.Compare the costs against the potential revenue generated from charging services.Reporting and Visualization: Present the simulation results through visualizations, graphs, and reports.Highlight the optimal locations for charging stations and provide insights into network performance under different conditions.In conclusion, simulating the optimal location of electric vehicle charging stations in the IEEE 33 bus distribution system involves a comprehensive analysis of network characteristics, charging demand, infrastructure capacity, and renewable energy integration.This simulation-driven approach helps utilities, policymakers, and stakeholders to make informed decisions about strategically placing charging stations to enhance the distribution network's performance while promoting sustainable transportation.

Conclusions
The simulation results will improve the effective utilization rate for solar energy resources in 24 h and solve the problem of EVCSs struggling to access the power grid.Therefore, integrated PV systems with grid-connected BESSs have been proposed and deployed in many areas.This paper presents an optimization model for a multipurpose design.The modeling solution proposed by the GA method was achieved by combining EVCSs, PV systems, and BESSs.The simulation system was evaluated using IEEE 33 bus grid model data for EVCSs in zones 1, 2, 3, 4, and 5, which are suitable for installation in the most suitable location and size.This may, therefore, be used to prepare for future installations of EVCSs, PV systems and BESSs within simulated zones 1, 2, 3, 4 and 5, which could determine the most suitable installation location and size.In zone 1, where an EVCS was installed at 200 kW at bus 8, the efficiency was determined by combining a PV system and the BESS.The total power loss of the system is reduced to 203.3782 kW or 33%, which can reduce the total power loss to the greatest possible extent.The simulation results show that the voltage is the best, and the power loss is the least when installing EVCSs,

Figure 1 .
Figure 1.Diagram of a PV system with BESS to support EVCS.

Figure 1 .
Figure 1.Diagram of a PV system with BESS to support EVCS.

Figure 2 .
Figure 2. Active distribution system connected with DGs and BESS.

Figure 2 .
Figure 2. Active distribution system connected with DGs and BESS.
active and reactive powers, respectively.

Figure 3 .
Figure 3. Model the load profile during peak and off-peak times.

Figure 3 .
Figure 3. Model the load profile during peak and off-peak times.

Figure 4 .
Figure 4. Flow chart of GA operation.

Figure 6 .
Figure 6.Regional simulation on the IEEE 33 bus distribution power grid.

Figure 6 .
Figure 6.Regional simulation on the IEEE 33 bus distribution power grid.

Figure 10 .
Figure 10.Load reactive power profiles before and after the changes to the grid.

Figure 11 .
Figure 11.Line reactive power profiles before and after the changes to the grid.

Figure 11 . 2 Figure 12 .
Figure 11.Line reactive power profiles before and after the changes to the grid.

Figure 12 .
Figure 12.Average suitable size of PV and BESS of GA case zones 1-5.

Figure 14
Figure14depicts the location-based deployment of electric vehicle charging stations (ECVSs) using "GA case zones 1-5", which most likely entails designing and carefully positioning charging stations for electric cars.Each of the five zones, denoted by the numbers 1 through 5, probably represents a particular region with a range of features, including population density, transportation facilities, and the adoption of electric vehicles.

Figure 12 .
Figure 12.Average suitable size of PV and BESS of GA case zones 1-5.

Figure 14 Figure 13 .
Figure14depicts the location-based deployment of electric vehicle charging stations (ECVSs) using "GA case zones 1-5", which most likely entails designing and carefully positioning charging stations for electric cars.Each of the five zones, denoted by the numbers 1 through 5, probably represents a particular region with a range of features, including population density, transportation facilities, and the adoption of electric vehicles.This location-based method aims to guarantee effective coverage of EVs and accessible EV charging infrastructure throughout the nation.Authorities may identify the best places for an EVCS in each zone by examining traffic patterns, charging demand, and current charging infrastructure.This tactical move lessens range jitters, encourages eco-Figure 13.Average convergence graph of GA case zones 1-5.

Figure 15
Figure15depicts the PV optimizer utilizing a 24 h timeframe and a genetic algorithm (GA) to determine the best times for the operation and scheduling of solar panels throughout the day.The system employs genetic algorithms to optimize energy generation from the PV system by considering variables like solar irradiance, weather, and 24 h energy consumption patterns.It is essential to effectively utilize solar energy to satisfy energy

Figure 15 .
Figure 15.Location-based PV using GA in IEEE 33 bus.

Figure 16
Figure16depicts the PV optimizer utilizing a 24 h timeframe and a genetic algorithm (GA) to determine the best times for the operation and scheduling of solar panel throughout the day.The system employs genetic algorithms to optimize energy

Figure 15 .
Figure 15.Location-based PV using GA in IEEE 33 bus.

Energies 2023 ,
16, x FOR PEER REVIEW 23 of 2 generation from the PV system by considering variables like solar irradiance, weather and 24 h energy consumption patterns.It is important to effectively utilize solar energy t satisfy energy demands and reduce dependence on non-renewable energy sources.Thi will help create a sustainable and ecologically friendly energy solution.

Figure 16 .
Figure 16.Location-based BESS using GA in IEEE 33 bus.

Figure 16 .
Figure 16.Location-based BESS using GA in IEEE 33 bus.

Table 1 .
The various works carried out by different researchers.

Table 2 .
Solar radiation and power data of photovoltaic system over 24 h.

Table 3 .
Report table for installation of EVCS, PV, and BESS on the IEEE 33 bus in five zones.