Dynamic Charging Optimization Algorithm for Electric Vehicles to Mitigate Grid Power Peaks

: The rapid proliferation of electric vehicles (EVs) presents both opportunities and challenges for the electrical grid. While EVs offer a promising avenue for reducing greenhouse gas emissions and dependence on fossil fuels, their uncoordinated charging behavior can strain grid infrastructure, thus creating new challenges for grid operators and EV owners equally. The uncoordinated nature of electric vehicle charging may lead to the emergence of new peak loads. Grid operators typically plan for peak demand periods and deploy resources accordingly to ensure grid stability. Uncoordinated EV charging can introduce unpredictability and variability into peak load patterns, making it more challenging for operators to manage peak loads effectively. This paper examines the implications of uncoordinated EV charging on the electric grid to address this challenge and proposes a novel dynamic optimization algorithm tailored to manage EV charging schedules efficiently, mitigating grid power peaks while ensuring user satisfaction and vehicle charging requirements. The proposed “Proof of Need” ( PoN ) charging algorithm aims to schedule the charging of EVs based on collected data such as the state of charge (SoC) of the EV’s battery, the charger power, the number of connected vehicles per household, the end-user’s preferences, and the local distribution substation’s capacity. The PoN algorithm calculates a priority index for each EV and coordinates the charging of all connected EVs at all times in a way that does not exceed the maximum allocated power capacity. The algorithm was tested under different scenarios, and the results offer a comparison of the charging power demand between an uncoordinated EV charging baseline scenario and the proposed coordinated charging model, proving the efficiency of our proposed algorithm, thus reducing the charging demand by 40.8% with no impact on the overall total charging time.


Introduction
Amid a global transition towards sustainable transportation, the electrification of transportation has gained significant momentum in recent years [1], driven by advancements in battery technology, supportive government policies, and growing consumer demand for sustainable mobility solutions.EVs offer numerous benefits [2], including reduced greenhouse gas emissions, improved air quality, and decreased reliance on finite fossil fuel resources.EV sales have experienced exponential growth over the last decade, with significant increases observed in many regions worldwide.This growth has been particularly pronounced in countries with supportive policies and incentives for EV adoption, such as Norway, China, and the United States [3][4][5].Automakers have significantly expanded their EV offerings, introducing a wide range of models across various vehicle segments.This increased variety has made EVs more accessible to a broader range of consumers, catering to different preferences and needs.However, the widespread adoption of EVs also introduces new challenges for the electrical grid, particularly concerning the management of charging infrastructure and its impact on the stability and efficiency of the electrical grid [6].The uncoordinated charging of EVs can create new peak demands in the electric grid's typical load profile.As EV ownership continues to grow, particularly in urban areas, the simultaneous charging of vehicles during peak periods can exacerbate existing grid congestion and strain infrastructure capacity.Unlike traditional loads, such as residential and commercial buildings, EV charging patterns exhibit high variability and unpredictability, driven by user behavior, vehicle characteristics, and charging infrastructure availability.During peak periods, the simultaneous charging of numerous EVs can overwhelm local distribution networks, necessitating costly upgrades and increasing the risk of grid outages.This uncontrolled influx of demand increases the risk of grid overloads and hampers efforts to integrate renewable energy sources effectively.Moreover, without coordinated charging strategies, utilities face heightened operational costs and may resort to fossil fuel-based generation to meet sudden surges in demand, undermining sustainability objectives.Addressing these issues necessitates developing and implementing intelligent charging management systems capable of optimizing EV charging schedules, smoothing out demand peaks, and ensuring grid reliability amidst the accelerating transition to electrified transportation.
Moreover, numerous other obstacles are associated with electric vehicle charging, spanning technical, economic, and infrastructure aspects.In many areas, there is a shortage of charging stations, particularly in rural and suburban locations, which can discourage the adoption of EVs.Additionally, the lack of standardized charging connectors and communication protocols can result in compatibility issues between EVs and charging stations [7].Similarly, varying payment systems and access methods across different charging networks can make it difficult for EV drivers to locate and pay conveniently for charging services.These factors can limit the use of EVs for long trips, hindering the rapid transition from traditional gas and diesel vehicles to EVs.Furthermore, while fast chargers are available, many charging stations offer slower charging speeds, resulting in longer wait times for drivers.Even with fast chargers, the time required to recharge an EV can still be significantly longer than refueling a traditional vehicle, which may inconvenience some drivers.At the grid level, concentrated EV charging in specific locations or during peak hours can strain the electricity grid, causing voltage fluctuations and potential instability.Expanding and upgrading the electricity grid to accommodate the increase in demand from EV charging can be costly and time-consuming.At the end-user level, some consumers may still hold misconceptions about EVs, such as concerns about battery life, safety, and performance, which can impede adoption.Increasing public awareness and understanding of EV technology, benefits, and charging options is crucial to overcome these barriers.Addressing these challenges requires collaboration among governments, utilities, automakers, charging infrastructure providers, and other stakeholders to invest in infrastructure, develop supportive policies, and promote the adoption of EVs.
On the other hand, advancements in smart charging technologies and communication protocols show potential for optimizing EV charging schedules and improving grid integration.These technologies utilize data analytics, artificial intelligence (AI) algorithms, and Internet of Things (IoT) devices to manage EV charging in real time and counter its unpredictable nature.By coordinating charging schedules across multiple EVs and optimizing resource allocation, smart charging systems can enhance grid stability, maximize renewable energy utilization, and minimize utility costs.This paper proposes a novel dynamic optimization algorithm designed to manage EV charging schedules efficiently, mitigating grid power peaks while ensuring user satisfaction and meeting vehicle charging requirements.Through load balancing and smart scheduling, the algorithm utilizes real-time data on grid load and EV charging demand to intelligently coordinate the simultaneous charging of all connected EVs without creating a peak demand at the level of the local distribution grid.
The proposed optimization algorithm is based on the Proof of Need (PoN) mechanism, which we introduce and detail in this article.This mechanism is a consensus among all end-users to identify which EVs require charging more urgently than others.It draws inspiration from consensus mechanisms in other areas, such as peer-to-peer (P2P) networks, blockchain, and Internet of Things (IoT) systems.These mechanisms are utilized in different distributed systems and protocols to reach agreement among multiple participants on transaction validity, network status, or event sequencing.Consensus mechanisms are crucial in ensuring distributed systems' integrity, reliability, and security by coordinating actions, validating data, and preventing malicious activities.In our scenario, the PoN determines a specific value that reflects the need for an EV to be charged.This value is then incorporated into our dynamic optimization algorithm to arrange the sequence of events, or in other words, the charging of EVs, in a manner that avoids any peak load or disruptions on the local electric distribution network.
The PoN dynamic charging optimization algorithm (PONDCOA) represents a paradigm shift in EV smart charging techniques, offering a holistic solution to the complex challenges posed by uncoordinated charging behavior.At its core, PONDCOA leverages an optimization algorithm, a consensus mechanism, an advanced communication protocol, and real-time data to dynamically adjust charging schedules based on real-time demand and grid conditions.Unlike traditional approaches that rely on predetermined charging schedules or static pricing models, PONDCOA continuously evaluates individual vehicles' needs and the grid's capabilities, optimizing charging decisions on the fly.By intelligently managing the timing and distribution of EV charging loads, the proposed algorithm aims to distribute EV charging loads across different periods to avoid peak demand spikes and balance the load on the electricity grid.By spreading out charging demand, the algorithm helps prevent grid congestion and voltage fluctuations, ensuring grid stability and reliability.Central to the effectiveness of PONDCOA is its ability to prioritize charging based on the immediate needs of EV owners while balancing the overarching goals of grid stability and efficiency.By analyzing factors such as battery state of charge, charging characteristics, and number of EVs connected per household, PONDCOA ensures that each vehicle is simultaneously charged without overburdening the grid or causing remarkable delays to the end-user.Simulation results demonstrate the algorithm's effectiveness in smoothing out power peaks and promoting the sustainability of EV charging infrastructure.
This article is divided into three parts.In the first part, we review the current challenges associated with uncoordinated EV charging and the existing methodologies used to solve this issue.Then, we introduce the methodology adopted to develop our proposed dynamic smart charging algorithm and the PoN consensus mechanism.In the final part, we introduce our simulation scenarios and the results we achieved compared to the uncoordinated EV charging baseline model.

Related Works
Addressing the challenges associated with uncoordinated EV charging requires a multifaceted approach that integrates technological innovations, regulatory reforms, and consumer engagement strategies.Article [8] emphasized the potential grid stability issues arising from simultaneous high-demand EV charging.Uncoordinated charging of EVs can lead to new peak load periods, where multiple vehicles charge simultaneously during highdemand hours [9]. Figure 1 illustrates the demand load peak caused by the uncoordinated charging of 500 EVs in the evening (between 4:00 and 8:00 p.m.) when drivers usually arrive back home from work and connect their vehicles to charge.This sudden increase in demand can strain the grid infrastructure and lead to voltage fluctuations and reliability issues.The sudden influx of EVs plugging in for charging during peak hours can lead to grid congestion and voltage fluctuations.This phenomenon, known as "charging stress", poses challenges for grid operators, requiring careful management to avoid disruptions.In addition to charging stress, EVs can impact voltage regulation within distribution networks.As article [10] discussed, unmanaged EV charging can cause voltage drops, particularly in areas with high EV concentrations.This necessitates the development of smart charging solutions that consider voltage constraints and optimize charging schedules accordingly.radation of battery life while still ensuring profitability for EV owners.By providing monetary rewards, utility companies, and governments can encourage EV owners to participate in V2G programs, where their vehicles' batteries are used to supply power back to the grid during peak demand periods.These incentives help offset the costs associated with the wear and tear on batteries caused by frequent charging and discharging cycles.Additionally, well-structured compensation schemes ensure that EV owners can achieve a net financial gain, making participation in V2G economically attractive.This approach not only promotes the wider adoption of V2G technology but also supports grid stability, energy efficiency, and the integration of renewable energy sources [14].On the other hand, the authors of article [15] discussed the challenges of grid congestion during peak EV charging hours.Without proper management, the simultaneous charging of EVs can strain local distribution networks, leading to voltage drops and Similarly, the integration of EVs also affects grid frequency response.The work conducted in [11] highlighted the potential for EVs to provide frequency regulation services through Vehicle-to-Grid (V2G) technologies.V2G allows EVs to discharge stored energy back to the grid during periods of high demand, enhancing grid stability and reducing reliance on traditional power plants for frequency support.The continued development of V2G technologies holds promise for grid integration.Article [12] discussed the potential for EVs to act as mobile energy storage units, providing grid services such as peak shaving and frequency regulation.V2G can transform EVs into valuable assets for grid operators, enhancing grid stability and reliability.In article [13], the authors presented a home energy management system that allows residential households to reduce their yearly energy bill in a dual tariff scheme using the EV's battery as a power shiftable load.However, financial incentives for V2G technology are essential to compensate for the potential degradation of battery life while still ensuring profitability for EV owners.By providing monetary rewards, utility companies, and governments can encourage EV owners to participate in V2G programs, where their vehicles' batteries are used to supply power back to the grid during peak demand periods.These incentives help offset the costs associated with the wear and tear on batteries caused by frequent charging and discharging cycles.Additionally, wellstructured compensation schemes ensure that EV owners can achieve a net financial gain, making participation in V2G economically attractive.This approach not only promotes the wider adoption of V2G technology but also supports grid stability, energy efficiency, and the integration of renewable energy sources [14].
On the other hand, the authors of article [15] discussed the challenges of grid congestion during peak EV charging hours.Without proper management, the simultaneous charging of EVs can strain local distribution networks, leading to voltage drops and increased line losses.This congestion not only affects EV owners but also impacts other electricity consumers connected to the same grid.Demand response strategies have been proposed to address peak load management challenges.One promising avenue for grid management is the implementation of time-of-use pricing schemes [16], which incentivize EV owners to shift their charging behavior away from peak periods, thereby reducing grid stress and lowering electricity costs.The work presented in article [17] explored the effectiveness of time-of-use pricing and incentive-based programs to encourage off-peak EV charging.By offering lower electricity rates during non-peak hours, EV owners are incentivized to shift their charging schedules, reducing stress on the grid during peak times.Additionally, demand response programs enable utilities to actively manage EV charging loads in real time [18], leveraging price signals and demand-side incentives to modulate charging rates and alleviate congestion on the grid.
In article [19], the authors investigated the role of smart charging algorithms in optimizing EV charging schedules.These algorithms consider factors such as grid conditions, electricity prices, and user preferences to determine the most cost-effective and grid-friendly charging times.By coordinating charging activities, smart algorithms can smooth out demand peaks and improve overall grid efficiency.Moreover, the convergence of EVs and smart grid technologies offers new opportunities for grid optimization.The authors of article [20] proposed the concept of an "EV-integrated smart grid", where EVs are seamlessly integrated into the grid's demand response and energy management systems.This holistic approach maximizes the benefits of EV grid integration while minimizing its impact on the electricity network.Additionally, as EV adoption grows, the demand for charging infrastructure increases accordingly.Article [21] discussed the challenges and opportunities of expanding EV charging infrastructure.Public charging stations, workplace chargers, and residential charging solutions are all essential components of a comprehensive EV charging network.However, deploying these charging points requires careful planning to ensure adequate coverage and accessibility for EV owners.
Furthermore, the authors in article [22] highlighted the need for grid upgrades to accommodate the growing EV fleet.Upgrading distribution transformers, power lines, and substations is crucial to prevent overloads and ensure reliable electricity supply to EVs and other consumers.Additionally, integrating fast-charging stations along highways and major routes requires significant infrastructure investments.EV grid integration also enhances energy diversification.The work conducted in article [23] discussed how EVs can serve as distributed energy resources, storing renewable energy during times of surplus and discharging it back to the grid when needed.This flexibility helps integrate variable renewable energy sources like wind and solar power, making the grid more resilient and sustainable.Furthermore, renewable energy-based charging stations contribute to energy independence and resilience, ensuring a more stable and reliable energy supply for the growing number of EVs on the road.By harnessing energy from renewable sources such as solar, wind, and hydropower, these stations reduce the reliance on fossil fuels and minimize the carbon footprint associated with EV charging [24].This not only supports the global transition to clean energy but also enhances the appeal of EVs by aligning their use with eco-friendly practices.
Nevertheless, despite the benefits, grid upgrades pose a significant challenge for EV grid integration.Article [25] emphasized the need for investment in grid infrastructure to support the increased demand for EVs.This includes upgrading distribution networks, installing smart meters, and deploying advanced grid management systems.However, with the increasing connectivity of EVs and charging infrastructure, cybersecurity is a significant concern.Article [26] highlighted the potential vulnerabilities of EVs to cyberattacks, emphasizing the need for robust cybersecurity measures.Secure communication protocols and encryption technologies are essential to protect EVs from unauthorized access and ensure data privacy.
One of the primary benefits of EV grid integration is reducing greenhouse gas emissions.The environmental and economic implications of EV charging management are also significant considerations.In article [27], the authors conducted a life cycle assessment to compare the environmental footprints of various EV charging scenarios, including home, workplace, and public charging.The results indicated that home charging with renewable energy sources had the lowest environmental impact.Article [28] offered a life cycle assessment of EVs and found that they emit significantly fewer greenhouse gases than gasoline vehicles, even when accounting for electricity generation emissions.The grid can mitigate climate change by promoting EV adoption and clean energy generation.Similarly, the work presented in [29] examined the economic feasibility of public EV charging infrastructure investments, highlighting the importance of cost-effective solutions to encourage widespread adoption.
On another level, interoperability and standards are critical for the seamless integration of EV charging infrastructure.The work presented in article [30] discussed the importance of standardized communication protocols between EVs, charging stations, and the grid.Common standards ensure compatibility and interoperability, allowing EV owners to easily access charging facilities across different networks.ISO 15118 [31] is an international standard that defines a communication protocol for the exchange of information between EVs and charging stations.This protocol is a key component in the development of smart charging infrastructure, enabling features such as Plug & Charge, where authentication and billing are seamlessly managed without user intervention.By standardizing the communication process, ISO 15118 facilitates interoperability between different manufacturers' EVs and charging stations, promoting a more user-friendly and efficient charging experience [32].Additionally, it supports advanced functionalities like bi-directional power transfer, enabling V2G services that can enhance grid stability and energy management.As the adoption of electric vehicles continues to grow, ISO 15118 plays a crucial role in ensuring that the necessary infrastructure is both reliable and scalable.Also, wireless EV charging can be a solution to address the issue of incompatibilities between EVs and charging stations.By standardizing wireless charging protocols and ensuring compatibility across different manufacturers, interoperability eliminates the need for multiple, often incompatible charging systems.Wireless power transmission (WPT) can become an important development trend due to its greater flexibility, convenience, safety, and intelligence compared with traditional contact charging [33].This seamless integration enhances the user experience, making it more convenient for EV owners to charge their vehicles without worrying about connector types or specific charging station compatibility.Moreover, it promotes widespread adoption of EVs by simplifying the infrastructure requirements and reducing the barriers to entry for new users.Interoperability also supports the development of smart cities and advanced transportation systems, where consistent and efficient wireless charging is essential for the smooth operation of diverse EV fleets.Ultimately, achieving wireless charging interoperability is a vital step toward a more sustainable and user-friendly electric mobility ecosystem.Moreover, effective policy and regulation play a crucial role in facilitating EV grid integration.The work presented in [34] emphasized the importance of supportive policies such as tax incentives, rebates, and mandates for EV adoption.Clear regulatory frameworks for EV charging tariffs and grid connection standards are also necessary to create a favorable environment for EV deployment.
Finally, integrating EVs into the grid presents challenges and opportunities for the energy sector.This comprehensive review has highlighted the impacts of EV charging on grid stability, peak load management, infrastructure requirements, and the broader benefits of EV grid integration.While challenges such as grid upgrades, interoperability, and cybersecurity persist, strategic planning and innovative solutions can leverage these challenges into opportunities for a more resilient and sustainable energy system.In this article, we present and test a new dynamic EV charging algorithm capable of balancing grid requirements with user needs, such as charging speed and time, to create a sustainable and efficient EV charging ecosystem.

Methodology
The decentralized nature of EV charging infrastructure makes it challenging to achieve a centralized EV charging management system.A decentralized and distributed methodology is needed to better suit the nature of EV charging and support electric mobility's diverse and evolving landscape.Our dynamic smart charging methodology is applied at the level of the end-of-line electric distribution networks, which are distributed by nature.Controlling the EV charging dilemma at a small modular level offers a systematic approach that can help address this complex issue effectively.Managing the coordination of EV charging at the level of substations involves implementing strategies to ensure that the increasing demand for EV charging does not overwhelm the distribution grid, leading to grid congestion, voltage instability, or other operational challenges.Deploying a smart charging infrastructure, equipped with communication and control capabilities at the substation level, allows for dynamic control of charging stations to optimize charging patterns based on grid conditions, energy needs, and the user's charger capacity, as well as balancing EV charging loads in real-time to maintain grid stability.By implementing an intelligent charging strategy and leveraging advanced technologies, it is possible to effectively manage the coordination of EV charging at the substation level while ensuring the electric grid's reliability, efficiency, and sustainability.
Advanced control and communication networks are vital for maximizing the potential of EV smart charging systems.These networks enable grid integration, load management, demand response, grid services, user interaction, and data-driven optimization.A robust communication network is essential as it facilitates real-time data exchange and seamless coordination among EVs, charging stations, grid operators, and available energy resources.This connectivity allows for dynamic load management by conveying crucial data, such as the connectivity of the EV to the charger, the current state of charge of the EV, and the number of charging EVs per household, from the chargers to the substation EV charging management system and, in return, the communication system will transmit the control signals to turn the charging on or off at each charging station (Figure 2).
The decentralized nature of EV charging infrastructure makes it challenging to achieve a centralized EV charging management system.A decentralized and distributed methodology is needed to better suit the nature of EV charging and support electric mobility's diverse and evolving landscape.Our dynamic smart charging methodology is applied at the level of the end-of-line electric distribution networks, which are distributed by nature.Controlling the EV charging dilemma at a small modular level offers a systematic approach that can help address this complex issue effectively.Managing the coordination of EV charging at the level of substations involves implementing strategies to ensure that the increasing demand for EV charging does not overwhelm the distribution grid, leading to grid congestion, voltage instability, or other operational challenges.Deploying a smart charging infrastructure, equipped with communication and control capabilities at the substation level, allows for dynamic control of charging stations to optimize charging patterns based on grid conditions, energy needs, and the user's charger capacity, as well as balancing EV charging loads in real-time to maintain grid stability.By implementing an intelligent charging strategy and leveraging advanced technologies, it is possible to effectively manage the coordination of EV charging at the substation level while ensuring the electric grid's reliability, efficiency, and sustainability.
Advanced control and communication networks are vital for maximizing the potential of EV smart charging systems.These networks enable grid integration, load management, demand response, grid services, user interaction, and data-driven optimization.A robust communication network is essential as it facilitates real-time data exchange and seamless coordination among EVs, charging stations, grid operators, and available energy resources.This connectivity allows for dynamic load management by conveying crucial data, such as the connectivity of the EV to the charger, the current state of charge of the EV, and the number of charging EVs per household, from the chargers to the substation EV charging management system and, in return, the communication system will transmit the control signals to turn the charging on or off at each charging station (Figure 2).The PONDCOA dynamic charging optimization algorithm, presented in this article, addresses the dynamic and rapidly evolving nature of EV charging.It efficiently allocates and utilizes available resources by applying the proof of need concept.This concept The PONDCOA dynamic charging optimization algorithm, presented in this article, addresses the dynamic and rapidly evolving nature of EV charging.It efficiently allocates and utilizes available resources by applying the proof of need concept.This concept fundamentally shifts the resource allocation paradigm by prioritizing and validating needs in real time.Unlike traditional methods that rely on static or predefined criteria, the PoN-based algorithm dynamically assesses the urgency and significance of each energy or resource allocation request.This ensures that resources are directed where they are most critically needed, enhancing overall system efficiency and reliability.
Proof of need for electric vehicle (EV) charging refers to the evidence or criteria used to prioritize charging sessions based on the urgency or necessity of the charging requirement.This concept is important in scenarios with limited charging infrastructure or during periods of high demand, where prioritization is necessary to ensure equitable access to charging resources.The PoN for each EV is calculated based on different decision factors:

•
State of charge; • Number of charging EVs per household; • The charging capacity of the EV's charger.
The PoN is calculated using the following equation: where The priority index n expresses the need to charge the EV battery according to its current SOC status.Since the priority index is directly proportional to the priority value, this will ensure that the EV with the higher priority index, which means with a lower SOC, will have the advantage of having a higher priority value and may start to charge before another EV with a lower priority index.Several methods exist to measure the SOC of a battery, each with its strengths and limitations.Voltage measurement is straightforward but can be inaccurate due to its non-linear relationship with the SOC and susceptibility to temperature and load variations.Coulomb counting, or Ah counting, tracks the current flow over time, providing decent accuracy but being prone to cumulative errors and requiring periodic recalibration.Impedance spectroscopy offers high accuracy by analyzing the battery's impedance at different frequencies but demands sophisticated equipment and analysis.Kalman filtering combines voltage and current data with a predictive model, enhancing accuracy through continuous adjustments.Machine learning algorithms leverage extensive datasets to predict the SOC with high precision, yet they depend on the quality and diversity of the training data.Among these, temperature compensation stands out as a critical factor for accuracy, as battery performance and voltage significantly vary with temperature [35].
By integrating temperature compensation with other methods, such as coulomb counting and voltage measurement, one can achieve the most reliable and accurate SOC estimation.As shown in Figure 3, the priority index can take only four values ranging from 1 to 4 based on the following conditions:

Maximum state of charge index:
The maximum state of charge index level Q is the difference between SOCmax and the current SOC of the EV battery, as shown in Equation (2).It expresses the remaining SOC until the battery reaches its maximum full charge status, as defined by the manufacturer.
Since the maximum state of charge index level is directly proportional to the priority value, the EV with a higher difference between SOC and SOCmax has the advantage of having a higher priority value and may start to charge before another EV with a lower maximum state of charge index level.

Number of charging EVs index:
The number of EVs factor k is defined as the penalty of having many EVs plugged in for charging simultaneously and in the same house.It is calculated using various conditions and may return multiple values for the same house if more than one EV is plugged in for charging.The preset value and the formula used to find the different values of the number of EVs factor k are as follows: This value applies to each house where a single EV is plugged in for charging.Also, this applies to the case where a single house has multiple EVs plugged in, but this value is only given for the EV with the lowest SOC in the house.
This formula applies for a single house with multiple EVs plugged in, but this value is only given for the EV that doesn't have the lowest SOC in the house.
The assigned index k is directly proportional to the proof of need.This means a higher k value should be assigned to the EV that needs charging the most, i.e., having the lowest SOC.In simpler terms, if two EVs are simultaneously plugged into the same house, the EV with the lowest SOC is assigned a k value of 1, while the second EV has a k value equal to ½.

Charger's capacity index:
The capacity of EV chargers plays a critical role in the optimization of electric vehicle (EV) charging, influencing not only the speed and efficiency of charging sessions.The higher the charger's capacity is, the higher the power levels it can deliver, thus significantly reducing the time required to charge an EV.This is particularly beneficial in scenarios where quick turnaround times are essential.Hence, because more time should be allocated to lower-capacity chargers,

2.
Maximum state of charge index: The maximum state of charge index level Q is the difference between SOC max and the current SOC of the EV battery, as shown in Equation ( 2).It expresses the remaining SOC until the battery reaches its maximum full charge status, as defined by the manufacturer.
Since the maximum state of charge index level is directly proportional to the priority value, the EV with a higher difference between SOC and SOC max has the advantage of having a higher priority value and may start to charge before another EV with a lower maximum state of charge index level.

3.
Number of charging EVs index: The number of EVs factor k is defined as the penalty of having many EVs plugged in for charging simultaneously and in the same house.It is calculated using various conditions and may return multiple values for the same house if more than one EV is plugged in for charging.The preset value and the formula used to find the different values of the number of EVs factor k are as follows: This value applies to each house where a single EV is plugged in for charging.Also, this applies to the case where a single house has multiple EVs plugged in, but this value is only given for the EV with the lowest SOC in the house.
This formula applies for a single house with multiple EVs plugged in, but this value is only given for the EV that doesn't have the lowest SOC in the house.
The assigned index k is directly proportional to the proof of need.This means a higher k value should be assigned to the EV that needs charging the most, i.e., having the lowest SOC.In simpler terms, if two EVs are simultaneously plugged into the same house, the EV with the lowest SOC is assigned a k value of 1, while the second EV has a k value equal to ½.

4.
Charger's capacity index: The capacity of EV chargers plays a critical role in the optimization of electric vehicle (EV) charging, influencing not only the speed and efficiency of charging sessions.The higher the charger's capacity is, the higher the power levels it can deliver, thus significantly reducing the time required to charge an EV.This is particularly beneficial in scenarios where quick turnaround times are essential.Hence, because more time should be allocated to lower-capacity chargers, we consider the charging capacity inversely proportional to the priority value.Therefore, the charger capacity index-equal to the charger's nominal power (P charger ) multiplied by its efficiency η charger -was included in the denominator of the PoN formula.As a result, an EV with a lower charging capacity has the advantage of receiving a higher priority value and may begin charging before another EV with a higher charging capacity.
The algorithm below (Algorithm 1) summarizes the PoN calculation method for each EV connected to a charging station: Applying the PoN concept to EV charging aims to ensure that charging resources are allocated efficiently and fairly based on the urgency and importance of the charging request.This ultimately optimizes simultaneous EV charging without significantly impacting the overall duration of the process or increasing congestion at electrical substations.However, including the grid power constraint as a main factor in the formula is essential.Our dynamic optimization model considered the available spare power capacity at the substation level as the lead indicator.This ensures that the additional power required for EV charging does not overload the substation.Therefore, in each iteration, the EVs that need to be charged are prioritized using the calculated PoN of each vehicle.The EVs with the highest PoN that satisfies the condition of Equation ( 5) are enabled for charging.The entire process is illustrated in the flowchart in Figure 4. where: P i, charger : The power in kW of the enabled EV charger i P Load : The total demand load in kW (excluding the charging of EVs) P Sub, max : The nominal power capacity of the substation in kW where:  , : The power in kW of the enabled EV charger   : The total demand load in kW (excluding the charging of EVs)  , : The nominal power capacity of the substation in kW

Simulation Model and Test Conditions
To test and validate the proposed dynamic EV charging optimization algorithm based on the PoN, a set of data, assumptions, and scenarios has been defined.For the simulation of the PONDCOA, we selected a set of EVs with different battery capacities that were equally distributed among different charger capacities.The combinations of selected EVs and chargers are presented in Appendix A. The selected 30 EVs used in the simulation have been randomly chosen by the algorithm from a list of 180 EVs.Also, the initial SoC of each EV's battery was randomly set by the algorithm as well.
Additionally, to define the priority index defined in the PoN equation, SOC*min and SOC*max must be defined for each EV.Hence, the following assumptions were made: • SOCmin: Although it is usually defined by the manufacturer, in this study, it is considered 30% of the SOCmax of the EV battery.• SOC*min: This is the minimum SoC defined by the user.In our simulation, SOC*min is assumed to be the round-up of SOCmin to the nearest multiple of 5.

•
SOC*max (or SOC*): This is an SoC defined by the user according to his needs and his range anxiety.EV range anxiety refers to the fear or concern that an EV will run out of battery power before reaching its destination or a suitable charging point.Hence SOC*max can take different values depending on the user's needs.To simplify the simulation, SOC*max is considered the energy needed to ensure a travel distance of 100 km without discharging the EV below SOC*min.
Another factor to be defined in our simulation is the grid power constraint.A grid capacity limitation should be defined to reduce the challenges imposed on the power grid

Simulation Model and Test Conditions
To test and validate the proposed dynamic EV charging optimization algorithm based on the PoN, a set of data, assumptions, and scenarios has been defined.For the simulation of the PONDCOA, we selected a set of EVs with different battery capacities that were equally distributed among different charger capacities.The combinations of selected EVs and chargers are presented in Appendix A. The selected 30 EVs used in the simulation have been randomly chosen by the algorithm from a list of 180 EVs.Also, the initial SoC of each EV's battery was randomly set by the algorithm as well.
Additionally, to define the priority index defined in the PoN equation, SOC* min and SOC* max must be defined for each EV.Hence, the following assumptions were made: • SOC min : Although it is usually defined by the manufacturer, in this study, it is considered 30% of the SOC max of the EV battery.• SOC* min : This is the minimum SoC defined by the user.In our simulation, SOC* min is assumed to be the round-up of SOC min to the nearest multiple of 5. • SOC* max (or SOC*): This is an SoC defined by the user according to his needs and his range anxiety.EV range anxiety refers to the fear or concern that an EV will run out of battery power before reaching its destination or a suitable charging point.Hence SOC* max can take different values depending on the user's needs.To simplify the simulation, SOC* max is considered the energy needed to ensure a travel distance of 100 km without discharging the EV below SOC* min .
Another factor to be defined in our simulation is the grid power constraint.A grid capacity limitation should be defined to reduce the challenges imposed on the power grid by the uncoordinated charging of EVs.This study aims to reduce the power demand resulting from uncoordinated EV charging.Therefore, the grid constraint is defined as the percentage (factor j) of the total power of all chargers connected to the substation at a time t, as given by Equation (6).
where: C: Charger's capacity j: Grid constraint factor in percentage N: Total number of charging EVs at time t i ∈ N On the other side, to assess the impact of the PONDCOA algorithm, a scenario including 30 EVs in 28 houses-i.e., 2 houses are considered to have 2 EVs each-has been considered.The connection schedule of the 30 EVs to the grid is defined as follows: • At t = 1, 10 EVs are connected for charging; • At t = 2, 5 EVs are connected for charging; • At t = 3, 10 EVs are connected for charging; • At t = 4, 5 EVs are connected for charging;

•
For the 2 houses with 2 EVs each, in one case, the 2 EVs are connected for charging both at the same time, and in the second case, the EVs are connected at different times.
In this scenario, t is the time in hours and t = 1 indicates the first hour of the peak period as defined by the grid operator.
In each algorithm iteration, connected EVs for charging are prioritized using the PoN methodology.Once prioritized, the algorithm adds EVs to the charging list in descending order of priority.With each addition, the charging power of the EV is added to the total demand of all previously selected cars.This total is then compared with the grid's maximum allowed charging power.If the addition of an EV causes the total demand to exceed the grid's limit, that EV is removed from the list of selected EVs, and the next prioritized EV is considered.This process continues until all EVs have been assessed.This methodology maximizes the number of EVs charging simultaneously without violating the grid's limitations.It may also allow lower-priority EVs to charge if their power demand does not exceed the grid's available power, thus utilizing the available power to the maximum.Once the list is finalized, the PONDCOA controller sends signals to the selected EVs' chargers, thus enabling those EVs to charge.The procedure's logic diagram is presented in Figure 5.

Simulation Results and Analysis
The performance of the PONDCOA algorithm has been compared to two basic scenarios.The first scenario is an uncoordinated EV charging model.Here, an EV begins charging immediately upon connection and continues until its battery is fully charged.This model doesn't consider any grid constraints, allowing us to simulate the impact of uncoordinated charging on the grid for a specific set of EVs.The second scenario considers a specific grid constraint.Therefore, at each iteration, only a portion of the connected EVs can charge to avoid exceeding the maximum allocated charging power.This scenario em-

Simulation Results and Analysis
The performance of the PONDCOA algorithm has been compared to two basic scenarios.The first scenario is an uncoordinated EV charging model.Here, an EV begins charging immediately upon connection and continues until its battery is fully charged.This model doesn't consider any grid constraints, allowing us to simulate the impact of uncoordinated charging on the grid for a specific set of EVs.The second scenario considers a specific grid constraint.Therefore, at each iteration, only a portion of the connected EVs can charge to avoid exceeding the maximum allocated charging power.This scenario employs the same grid constraint formula as defined in Equation ( 6).However, it doesn't apply the PoN prioritization algorithm.Instead, the EVs allowed to charge are selected based on a First Come, First Served (FCFS) methodology.These scenarios are evaluated based on two criteria: the maximum charging power demand in kW and the total time required to charge all vehicles.
Figures 6 and 7 illustrate the comparison of the PONDCOA algorithm to the two baseline scenarios: the uncoordinated charging and the FCFS scenario with a grid constraint.The j value for the grid constraint, as defined in Equation ( 6), has been set to 0.35 (or 35%) for both the PONDCOA algorithm and the FCFS with the grid constraint model.
Both the PONDCOA and the FCFS models show a reduction in peak charging demand compared to the uncoordinated charging model.In both cases, this peak has been reduced from 115 kW to 68 kW (a reduction of 40.8% at t = 4).However, the main difference between the PONDCOA and the FCFS models is the time required to charge the 30 EVs fully.This can be seen in Figure 7, which shows the number of EVs charging simultaneously at each time.In the case of the FCFS with grid constraints, it took 12 h to fully charge the 30 EVs, whereas the PONDCOA algorithm was able to charge all vehicles in 10 h without exceeding the maximum set charging power demand.
The FCFS algorithm considers grid constraints but does not include the PoN prioritization function.Therefore, while it can limit the simultaneous charging of EVs, it takes more time to fully charge all EVs, as shown in Figure 7.With the PONDCOA algorithm, we can charge all vehicles in a shorter time, similar to uncoordinated charging, but without exceeding the grid constraint limit.In terms of driver satisfaction, all EVs are fully charged within the time limits originally required by the baseline model (uncoordinated charging).
World Electr.Veh.J. 2024, 15, 324 14 of 19 EVs fully.This can be seen in Figure 7, which shows the number of EVs charging simultaneously at each time.In the case of the FCFS with grid constraints, it took 12 h to fully charge the 30 EVs, whereas the PONDCOA algorithm was able to charge all vehicles in 10 h without exceeding the maximum set charging power demand.The FCFS algorithm considers grid constraints but does not include the PoN prioritization function.Therefore, while it can limit the simultaneous charging of EVs, it takes more time to fully charge all EVs, as shown in Figure 7.With the PONDCOA algorithm, we can charge all vehicles in a shorter time, similar to uncoordinated charging, but Additionally, several simulations have been conducted to assess the impact of the grid constraint's index j on the performance of the proposed algorithm.Figure 8 shows that the lower the value of j, the greater the reduction of the peak charging demand.However, a very low j value can lead to a longer time to fully charge all vehicles (in the cases of j = 0.35 and j = 0.275).On the other hand, a high value of j can have a minimal impact on reducing the peak charging demand, such as in the case of j = 0.55.In the case of the considered 30 EVs, the optimal value of j is 0.35, where we achieved a 40.8% reduction of the peak charging demand while charging all vehicles in 10 h (same time as the uncoordinated scenario).
World Electr.Veh.J. 2024, 15, 324 15 of 19 without exceeding the grid constraint limit.In terms of driver satisfaction, all EVs are fully charged within the time limits originally required by the baseline model (uncoordinated charging).Additionally, several simulations have been conducted to assess the impact of the grid constraint's index j on the performance of the proposed algorithm.Figure 8 shows that the lower the value of j, the greater the reduction of the peak charging demand.However, a very low j value can lead to a longer time to fully charge all vehicles (in the cases of j = 0.35 and j = 0.275).On the other hand, a high value of j can have a minimal impact on reducing the peak charging demand, such as in the case of j = 0.55.In the case of the considered 30 EVs, the optimal value of j is 0.35, where we achieved a 40.8% reduction of the peak charging demand while charging all vehicles in 10 h (same time as the uncoordinated scenario).The analysis of the simulation results for the PONDCOA algorithm designed to coordinate the charging of EVs while respecting grid constraints and driver preferences reveals promising outcomes.The algorithm successfully balances the electricity demand, ensuring that the grid operates within its capacity limits while accommodating the individual charging needs and preferences of EV drivers.The simulations demonstrate that the algorithm can dynamically adjust charging schedules based on the PoN of each EV, preventing overloads and reducing peak demand.Additionally, it respects driver preferences such as charging time and required energy levels, achieving a high level of user satisfaction.The results indicate that this coordinated approach not only enhances grid stability but optimizes the overall charging process, paving the way for more efficient and driver-friendly EV charging solutions.

Conclusions
The electrification of transportation presents a transformative opportunity to decarbonize the transportation sector and build a more sustainable energy future.However, realizing this vision requires proactive measures to manage the grid impacts of EV charging, especially the peak charging demand caused by uncoordinated charging patterns, to ensure the electrical infrastructure's reliability and resilience.The presented work offers a robust solution to mitigate the risk of peak charging demand caused by uncoordinated charging of EVs.The PONDCOA algorithm can manage the simultaneous charging of several EVs by using the PoN methodology without impacting the overall time to fully charge the vehicles or causing a peak charging demand.Simulation results demonstrate a significant reduction in peak demand without impacting the overall total charging time while respecting the end-user's preferences.Such an algorithm can be used not only to manage the charging of EVs at the local power substation level but also to manage the charging of EV fleets for any company or facility.
Moreover, the algorithm's adaptability to varying grid conditions and user preferences makes it a versatile tool for future smart grid applications.As the adoption of EVs continues to rise, such a dynamic management system will be crucial in maintaining grid reliability and efficiency.Further research could explore the integration of the PONDCOA algorithm along with other V2G or vehicle-to-vehicle (V2V) strategies to unlock the full potential of electric vehicles as a catalyst for grid modernization and sustainable development.Overall, this work contributes to the sustainable evolution of EV infrastructure, promoting a more resilient and responsive energy system.The practical implementation of this algorithm can support utilities and stakeholders in navigating the challenges of increasing EV penetration, paving the way for a cleaner and more efficient energy future.
Continued research and innovation are essential for overcoming the technical, economic, and regulatory barriers to effective EV grid integration.Critical areas for future investigation include the development of interoperable charging standards, deploying vehicle-to-grid (V2G) and vehicle-to-vehicle (V2V) technologies, and integrating EV charging infrastructure with renewable energy systems and energy storage solutions.Moreover, policymakers must enact supportive regulations and incentives to encourage the adoption of grid-friendly charging practices and foster collaboration between stakeholders across the transportation and energy sectors.

Figure 1 .
Figure 1.The increase in load demand caused by the uncoordinated charging of 500 EVs

Figure 1 .
Figure 1.The increase in load demand caused by the uncoordinated charging of 500 EVs.

•
If SOCmin ≤ SOC < SOC*min, then n = 3, where SOC*min is the minimum state of charge desired by the user.• If SOC*min ≤ SOC < SOC*max, then n = 2, where SOC*max is the maximum state of charge desired by the user.• If SOC*max ≤ SOC ≤ SOCmax, then n = 1, where SOCmax is the maximum state of charge of the EV battery as defined by the manufacturer.

Figure 3 .
Figure 3. Distribution of the priority index n.

Figure 3 .
Figure 3. Distribution of the priority index n.

Figure 4 .
Figure 4. Proof of need flow chart.

Figure 4 .
Figure 4. Proof of need flow chart.

Figure 7 .
Figure 7.Comparison between the total number of charging EVs at each time t, for uncoordinated charging vs. FCFS with grid constraints vs. PONDCOA at j = 0.35.

Figure 7 .
Figure 7.Comparison between the total number of charging EVs at each time t, for uncoordinated charging vs. FCFS with grid constraints vs. PONDCOA at j = 0.35.

Figure 8 .Figure 8 .
Figure 8. PONDCOA simulation with 30 EVs at different grid capacity factors.The analysis of the simulation results for the PONDCOA algorithm designed to coordinate the charging of EVs while respecting grid constraints and driver preferences reveals promising outcomes.The algorithm successfully balances the electricity demand, ensuring that the grid operates within its capacity limits while accommodating the indi- where SOC min is the minimum state of charge of the EV battery as recommended by the manufacturer,•If SOC min ≤ SOC < SOC* min , then n = 3, where SOC* min is the minimum state of charge desired by the user.•IfSOC* min ≤ SOC < SOC* max , then n = 2, where SOC* max is the maximum state of charge desired by the user.
•If SOC* max ≤ SOC ≤ SOC max , then n = 1, where SOC max is the maximum state of charge of the EV battery as defined by the manufacturer.