Economic energy scheduling of electrical microgrid considering optimal participation of the electric vehicles

. This research presents a strategy for managing energy scheduling within an electrical microgrid, with a speci ﬁ c focus on enhancing the integration of electric vehicles (EVs). By incorporating Monte Carlo simulation to address uncertainties related to EV charging power and demand-side variables, the study aims to ensure precise outcomes. The economic energy scheduling is conducted on a day-ahead basis, considering these uncertainties to assess the ef ﬁ ciency of the recommended approach. The primary objective is to reduce the overall system costs, encompassing operational expenditures and EV charging power. To tackle the intricacies of the operational framework, the study utilizes the modi ﬁ ed sun ﬂ ower optimization (MSFO) algo-rithm to resolve the outlined issue. The simulation ﬁ ndings highlight the superior performance of the proposed optimization algorithms compared to others. The proposed approach leads to minimizing the cost of microgrids by 4.31%, 3.82%, and 1.87% to the genetic algorithm (GA), Particle swarm optimization (PSO) algorithm, and Teaching learning-based optimization (TLBO) algorithm, respectively.


Introduction
Today's societies are currently grappling with environmental problems and energy crises, which are pressing issues that require immediate resolution [1].The overreliance on fossil resources during these energy crises poses significant challenges for countries that lack access to such resources [2].Additionally, the utilization of fossil resources in largescale power plants for electricity generation presents serious environmental concerns for nations [3].Furthermore, these fossil fuel-based power plants have inherent drawbacks, including high operational costs, limited flexibility in supplying electricity during crisis situations, and low efficiency [4].Moreover, the transmission of power from these large power plants through transmission lines to meet the demands of distribution networks results in substantial losses and numerous power quality issues for the overall power system [5].To address these challenges, the integration of renewable-based power generation units into the power system has been introduced through the establishment of microgrids [6].These microgrids, facilitated by the development of smart grids and the provision of necessary infrastructure, are a collaborative effort by the consortium for reliability technology solutions [7].The electrical microgrids are compact distribution networks operating at a small scale within the broader distribution network framework [8].These microgrids consist of multiple small-scale power plants that can function independently or be connected to the main grid.Distributed energy resources (DERs) are strategically placed within microgrids, enhancing power quality reliability and improving the overall flexibility of distribution networks [9].The integration of microgrids into regular operations and the potential for power interchange with them can lead to a substantial increase in the energy efficiency of these distribution grids.Additionally, the utilization of small DERs that rely on renewable energy sources within microgrids can offer a significant contribution to reducing environmental pollutants.Moreover, the presence of DERs in microgrids and the option for them to operate autonomously during crisis situations can bolster the reliability of distribution networks [10,11].Microgrids encounter a primary challenge in effectively managing their resources when connected to the main power grid, particularly in the presence of uncertainties.The optimization of scheduling for microgrids necessitates the consideration of various objective functions.These functions need to be fine-tuned, whether through maximization or minimization, while also factoring in technical and environmental constraints.The efficient operation of the generation side within microgrids offers numerous benefits for both energy consumption and generation.By implementing optimal strategies, consumers can reduce electricity costs, while simultaneously enhancing the power quality and stability of microgrids.As a result, the development of novel scheduling frameworks for microgrids is imperative [12,13].
Numerous research studies have been conducted to address the operational challenges faced by electrical grids, emphasizing economic factors.The energy systems in [14] utilize a scheduling approach to efficiently handle the probabilistic constraints of energy resources.By including resources as reserves, the goal is to reduce operational costs.In [15], the planning problem for an energy system is mathematically formulated to allocate the output power of resources.To minimize the generation cost linked to energy sources, an enhanced genetic algorithm is employed to solve the resulting model.The utilization of benders decomposition modeling is explored in [16] to effectively handle uncertainties in electric vehicles (EVs) and loads during operation.Reference [17] explores the application of the membership method to investigate the economic assessment in energy systems.In [18], a method is introduced that employs strong modeling as a mathematical optimization technique.The goal of this technique is to reduce electricity expenses in residential environments by considering the operational patterns of appliances and power generation units.The authors of [19] utilized a learning method-based optimization algorithm to tackle an optimal model of demand planning.This model factored in the demand response to energy prices to efficiently control load utilization.An algorithm based on constraint modeling is employed to tackle a robust operational obstacle in an energy system, which relies on the time scales of demands [20].In [21], the trajectory-battery is employed to design electric pump engines in microgrids.Meanwhile, authors in [22] tackle the energy management issue by introducing multi-objective modeling.The solution to this model is efficiently achieved through the use of the improved genetic algorithm.Reference [23] presents a discussion on the placement and dimensions of storage systems through EVs while considering reliability metrics.In [24], the representation of EVs' energy scheduling in an energy system is depicted as a joint modeling.A model in [25] represents the economic concerns of EVs and cars, and it is then tackled using an evolutionary algorithm.
The review of the literature for this study reveals gaps in previous research on the impact of high EVs penetration on optimal electrical microgrid scheduling.Considering the stochastic nature of EV behavior in distribution networks, it is crucial to include EVs in microgrid operation efficiency.
To fill this research gap, a new methodology is proposed by the researchers to optimize energy scheduling in electrical microgrids, focusing on EV integration.To ensure the accuracy of their results, uncertainties related to EV charging power and demand-side variables are taken into consideration.Monte Carlo simulation is used to incorporate these uncertainties into the analysis.Economic energy scheduling is carried out on a day-ahead basis, considering uncertainties, to assess the effectiveness of the proposed method.The main goal of the scheduling is to minimize overall system costs, including operational costs and EV charging power.To address the complexities of the operational framework, the researchers utilize the modified sunflower optimization (MSFO) algorithm to solve the problem at hand, chosen for its ability to handle optimization intricacies.

System modeling
The illustration in Figure 1 showcases the residential distribution electrical grid.In terms of data flow, there exists a bidirectional exchange of information between the generation and demand aspects.The system operator's perspective is taken into account when designing the proposed framework for this microgrid.The proposed objective functions consist of minimizing costs.The suggested system includes DERs such as wind turbine (WT), batteries, micro turbine (MT), and photovoltaic (PV) systems and EVs.The energy market offers different prices for the power generation of the main grid based on the time of day.The consumers make up the demand side.The demand side consumes the power generation.Loads are demand side or energy consumers.The operator needs various input data to effectively make decisions in the system.More specifically, the operator can tackle optimization challenges according to set goals within the grid, managing the data flow between generation and the demand side.In the end, the operator evaluates the results to understand how different factors impact energy scheduling for the next day.

Objective function modeling
The financial sustainability of the network is greatly dependent on the energy cost, as it plays a crucial role in influencing the purchasing and selling capabilities.In some situations, even though the microgrid can provide power through its DERs, it might be more economical to buy electricity from the main grid because of the cheaper rates.Moreover, if the microgrid integrates storage units, they can be charged when electricity prices are low and discharged during high price periods, effectively reducing expenses.To facilitate economic dispatch within the microgrid with the help of an operator, it is vital to define the objective function in the following manner: Here B Gi is bid for micro turbine (MT) i and B sj is bid for storage j. S Gi is the start-up cost and S sj is the shut-down cost.N g and u t shows the number of MTs and binary variables.N s indicates the number of storage systems.P Grid is the exchange power with the main grid and B Grid is the cost.

EV modeling
The EVs commonly utilize storage devices like rechargeable batteries, and they have the capability to be fully charged by connecting to the main power grid and discharged as needed by either traveling or connecting back to the grid.
To accurately model the performance of EVs, it is crucial to take into account specific parameters that indicate the behavior of these vehicles.These parameters include the type of charger used and the ratio of the current energy level to the maximum energy capacity that can be stored in the battery.The demand for EV charging is an uncertain factor, as it depends on whether the EVs are charged at public stations or within residential communities.Throughout the day, EVs typically follow two main routes.The first route occurs when drivers leave their homes early in the morning, while the second route is taken when they return home from work.Hence, EV can be modeled as follows [26,27]: In the synchronized charging approach, EV owners opt to link their vehicles to the primary power grid during nonpeak periods.This strategy ensures that the EVs are not connected to the utility grid during high-demand periods, thereby minimizing system costs.The coordinated charging method is represented by the following model: In the smart charging pattern, the process is done in such a way that the least cost is achieved, in fact, charging is done in the conditions of low electricity prices or low electricity demand.The smart charging patterns provide many advantages for the control and operation of the system by normal modeling as follows: 3 Constraints modeling

Energy balance modeling
The energy generation on the generation side should be consumed by the demand side at any time.Hence, the energy balance is modeled as follows: Here P Lk and N k are the kth load level and the related set, respectively.P t,PV and P t,wt are the power of PV and WT, respectively.

Energy generation limit modeling
The power generation limit is modeled as follows: Here P Grid,min(t) and P Grid,max(t) are the exchanged energy between the microgrid and the main grid.

Battery constraints modeling
The modeling battery is as follows [28][29][30]: Where P s,charge and P s,discharge are charge and discharges powers.W ess,t is stored energy in the battery, Dt is the time interval, max/min are maximum/minimum values.g charge and g discharge are charging and discharging efficiencies.

Uncertainty modeling
There are multiple techniques available for modeling the optimal operation of the MG stochastically.These techniques can be categorized into four main methods: Monte Carlo Simulation approach (MCS), and Analytical and Approximate methods.In this paper, the MCS method is chosen for modeling due to its ability to effectively handle complex uncertain variables [31][32][33][34][35][36][37].

Solving method
The sunflower tracking pattern provides a reliable method for determining the optimal sun exposure.Pollination in this research was found to be random and occurred when flowers were at their furthest distance from each other.Normally, a lone flower patch has the ability to emit millions of pollen gametes with each sunflower producing only one.Another optimization technique is based on the inverse square law radiation.This principle states that radiation intensity decreases as the square of the distance increases.For instance, doubling the distance results in a fourfold decrease in intensity, while tripling the distance leads to a ninefold decrease.The plant's proximity to the sun determines the amount of radiation it receives, with closer plants receiving more radiation.Conversely, plants further from the sun receive less radiation.This study follows this pattern to achieve optimal results in sunflower heat absorption [38].
The power of the source is denoted as P s , while the space between the plant i and present best is indicated as d i .
The orientation of the sunflower towards the sun can be represented by the following model: The ith plantation and the current plantation are denoted by X i and X * , respectively.The sunflowers' movement in direction S i can be evaluated as: In order to achieve the best global result, you must restrict the maximum step using the equation provided.
The highest and lowest values are X max and X min .The overall population is denoted as N pop .The new plantation can be illustrated as:

Modified sunflower optimization (MSFO) algorithm
Despite the effectiveness of the suggested algorithm in solving optimization problems, there are still some limitations that need to be addressed.One of the main challenges faced with the sunflower optimization algorithm is early convergence.Individuals using this algorithm tend to focus on finding the best solutions near the optimal point, leading to a lack of exploration in the rest of the solution space due to the imbalance between local and global search.To tackle this issue, the MSFO algorithm introduces a new approach.The premature convergence issue, which results in longer running times, is caused by the accidental population distribution across different parts of the sunflower optimization in iteration.By incorporating Lévy flight (LF) as a parameter, the performance of bio-inspired optimization algorithms can be significantly enhanced, effectively combating premature convergence.This parameter allows for a random walk technique to be implemented to regulate the local search, ultimately addressing the premature convergence limitation [39,40].
The LF tool (s) is defined within the range [0, 2] (with a value of 1.5), where A follows a normal distribution N(0, r2) and B follows a normal distribution N(0, r2).
The Gamma function is denoted by (.), w represents the step size, and A/B follows a normal distribution N(0, r2) indicating a mean value of zero and variance of r2.The new plantation implemented using the LF mechanism is as follows: In Algorithm 1, the MSFO process is shown.The initial stage of the suggested algorithm involves generating a population of individuals that is either random or evenly distributed.By evaluating each individual, it becomes feasible to determine which one has the potential to move closer to the sun.Currently, the algorithm considers only one sun, but future versions will allow for multiple suns.Subsequently, the remaining individuals adjust their positions towards the sun, similar to sunflowers, by taking random steps in a specific direction.

Case studies and results
In this section, the optimization results of the proposed approach are analyzed based on some case studies.The data of systems such as DERs are extracted from references [41][42][43][44][45].The electrical microgrid is shown in Figure 2. The aim of this segment is to display the outcomes of 24-h scheduling and calculate the performance of DERs in each time period at the lowest possible cost.To simplify matters, DERs function at a power factor of one, meaning they do not generate reactive power within the microgrid.Figure 3 provides a highly accurate representation of the output power for both the WT and PV system.Figure 4 displays the main grid price (utility) in the energy market, while Figure 5 presents the load demand quantity.Two case studies were conducted to assess the MFSO optimization algorithm and the effectiveness of the proposed model in the presence of EVs.The cases involved evaluating the optimal operation of the system with and without taking EVs into account.In case 1, all DERs are active for 24 h after the batteries are fully charged.However, in case 2, the batteries start off uncharged and DERs have the flexibility to be turned on or off as needed.

Case 1
The evaluation of the problem of optimal operation in this article spans a duration of 24 h.The proposed model exhibits the potential for seamless adaptation to weekly, monthly, and yearly planning, delivering commendable performance.The unrestricted development of this model highlights its superiority over alternative methods.During the initial hours, as depicted in Figures 6 and 7, the battery initiates charging owing to the low tariff.However, this leads to a decrease in the output of costly units within the microgrid.Conversely, when electricity prices soar, the battery is discharged and the production of DERs within the microgrid is maximized.This results in an increase in exported power, effectively reducing overall costs.MT is a costly DER that generates a minimal amount during the early hours when energy prices are at their peak.During the hours of 9:00 to 17:00, it is more cost-effective to ramp up MT production in order to lower overall expenses as prices rise.The battery begins charging within the initial six hours due to the affordable energy cost in the main grid.However, between 8:00 and 14:00, the battery starts discharging because of the expensive energy prices in the main grid, as illustrated in Figure 6.

Case 2
The battery must be charged during the first few hours to ensure it can be discharged efficiently later on, reducing costs.As shown in Figures 8 and 9, the MT, being a costly component, effectively charges the battery initially.By implementing this approach, it becomes feasible to lower the expenses of the microgrid by depleting the battery during peak demand periods when electricity prices are high on the main grid.The primary grid and the MT are additional DERs that can help charge the battery during offpeak hours, thereby minimizing costs by discharging it during high-price periods.It is important to note that due to its high cost, utilizing the MT unit for charging the battery at any other time of the day is not economically viable, except during the initial hours.Based on Figure 8, the battery is charged by 8:00 thanks to the affordable energy prices in the main grid, and predictably, it is discharged between 8:00 and 14:00 to minimize system expenses caused by the high energy prices in the main grid.The worst m% solutions are removed from the population and replaced with the new individuals.9: The solutions update their position based on the lèvy flight operator: 10: Calculate the fitness function for the new solution (sunflowers) in the population f X ðtÞ i .
11: The new solutions are accepted if their fitness are better than the current solutions.12: Set t = t + 1. 13: until (t > max itr ).14: The overall best solution is presented.
The MSFO optimization algorithm has undergone comparisons with other renowned algorithms, and the simulation results consistently demonstrate the comparison of the best, worst, and average solutions.In Table

Impact of EVs on the case studies
In this section, the impact of EV participation on the microgrid in cases 1 and 2 is implemented.The upcoming discussion will focus on the charging requirements of EVs.Additionally, we have taken into account all uncertainties to ensure accurate outcomes.The uncertainty of the problem has been modeled using the Monte Carlo simulation.
In order to do this, the Monte Carlo simulation is initially developed and integrated into the optimal scheduling model, considering uncertainties in EV charging demands, load, and electricity price.In Figures 12 and 13, the power dispatch of microgrid in Cases 1 and 2 with EVs participation is shown.The charging demand needed for EVs is seen as an extra burden on the microgrid, causing the power purchased from the main grid to rise from 31 kW to 115 kW.By enhancing the injected power into the system, the necessary demand is met.It is evident that the limitations of the MG test system and the charging requirements of EVs necessitate modifications, and implementing these adjustments will ensure a more efficient power supply to meet the demand for EVs.Turning off MT during specific hours improves the EV charging process, leading to a higher intake of power from the main grid.By efficiently managing the energy requirements of electric vehicles, the expenses of the system can be minimized.This indicates that during peak charging times, the cost of the system will rise with      the increased power import from the main grid.In Table 2, the results of case studies with the participation of EVs and other algorithms are compared.In Figures 14 and 15, the energy demand of EVs is shown.The energy demand is scheduled at the low price of the main grid.

Conclusion
The investigation in this study focuses on the charging demand of EVs in a microgrid, taking into account uncertainties, to achieve optimal operation.A new smart charging pattern is suggested to address the integration of EVs in microgrids.By implementing this recommended charging pattern, public charging stations can effectively manage costs and ensure efficient operations.The MSFO algorithm has proven to be highly effective in optimization, outperforming other conventional approaches in all the case studies examined.Using an efficient charging approach for EVs can significantly reduce the overall system expenses.Consequently, the issue of widespread adoption of EVs can be effectively addressed.The simulations have shown that the MSFO algorithm outperforms other algorithms in terms of finding the most efficient solutions for utilizing EVs as a means of reducing costs.This innovative approach offers new insights into how EVs can be integrated with energy storage methods like MSFO to maximize cost savings and improve overall energy efficiency.By leveraging the capabilities of EVs in conjunction with advanced storage technologies, businesses, and individuals can potentially achieve significant cost reductions while also contributing to a more sustainable energy system.The promising results of these simulations suggest that the MSFO algorithm has the   potential to revolutionize the way we think about energy storage and management in the context of EVs.

Algorithm 1 .. 5 :
MSFO process.1: Initialize the parameter values for the rate of mortality m, population size N, the rate of pollination P and the maximum number of iteration max itr .2: Initialize the iteration counter t := 0. 3: The initial population X ðtÞ i is generated randomly, i = 1,. ..,N. 4: Calculate the fitness function for all solutions (sunflowers) in the population f X ðtÞ i The overall best solution is assigned X*. 6: repeat 7:All solutions adjust their orientation toward the sun (best solution)X*.8:

Figure 4 .
Figure 4. Main grid price in energy market.

Figure 6 .
Figure 6.Power generation of MT, battery, and main grid in Case 1.

Figure 7 .
Figure 7. Participation of the battery than utility price in Case 1.

Figure 8 .
Figure 8. Power generation of MT, battery, and main grid in Case 2.

Figure 9 .
Figure 9. Participation of the battery than utility price in Case 2.

Figure 10 .
Figure 10.Comparison of the MSFO based on best solution than other methods in Case

Figure 12 .
Figure 12.Power generation of MT, battery, and main grid with participation of EVs in Case 1.

Figure 13 .
Figure 13.Power generation of MT, battery, and main grid with participation of EVs in Case 2.

Figure 14 .
Figure 14.Demand of EV in Case 1.

Figure 15 .
Figure 15.Demand of EV in Case 2.
1, MSFO in case 2 is compared to other methods.The other methods are genetic algorithm (GA), Particle swarm optimization (PSO) algorithm, and Teaching learning-based optimization (TLBO) algorithm.The table of simulation results highlights the superior performance of the MSFO algorithm in comparison to other methods.The proposed algorithm's remarkable

Table 1 .
Comparison of the MSFO then other methods in Case 2.

Table 2 .
Results of case studies in all algorithms with EVs participation.The Author(s): Science and Technology for Energy Transition 79,42 (2024)