Multi-objective optimization of distributed energy resources based microgrid using random forest model

ABSTRACT


INTRODUCTION
In last few decades, the depletion of fossil fuels has had a substantial impact on energy consumption, making it more difficult to meet the rising energy needs of economies and populations.Therefore, the development of the power industry over the past few years has been greatly aided by the switch from a traditional grid to a sustainable energy grid.The integration of distributed energy resources (DERs) such as wind, solar, hydro, combined heat and power (CHP) units, fuel cell (FC), micro-gas turbine (MT), and battery energy storage systems into the grid system has become a recent trend in power systems.A microgrid with DERs is a localized power system that operates independently or in conjunction with the main electrical grid.It provides reliable and sustainable electricity to a specific geographic area, such as a neighborhood, community, or industrial facility [1]- [3].One of the key challenges of incorporating renewable energy sources such as solar, wind, and hydro into the microgrid (MG) system is the variability of these sources.To overcome this difficulty, energy storage systems like batteries and flywheels can be utilized to store extra energy produced during periods of shortages and discharge it during periods of increased demand [4], [5].The use of battery energy storage systems (BESS) in MG helps to reduce the energy cost, careful planning, and management.This includes selecting the appropriate battery technology and capacity and installing monitoring and control systems to regulate the energy flow.Also, several studies and analyses are done for optimal sizing and charging and discharging of batteries when renewable energy systems (RESs) are also considered in MG [6].The literature has provided a variety of metaheuristic optimization solutions over the past few decades for solving the sizing and cost problem [7]- [9].The usage of traditional procedures based on iterative, numerical, or analytical methods has significantly decreased because of their delayed reaction and results.Numerous studies have examined the use of such algorithms to address the battery sizing problem of renewable energy systems producing better outcomes [10], [11].Recently, due to the advancement in artificial intelligence (AI) tools, machine learning-based optimization techniques are implemented in MG for fast convergence and more accurate results [12], [13].
In this paper, multi-objective optimization of the proposed DERs based MG system is performed using the ensemble learning based random forest (RF) method to determine the optimal sizing of batteries for various seasons and reduce the cost of battery charging.To analyze the proposed MG system, the real-time load data, meteorological variables of wind speed, and solar radiation for Bengaluru City (Karnataka, India) for 24 hours a day for the year 2022, i.e., from January 1 st , 2022, to December 31 st , 2022, are considered.The novelty of this research is to propose an MG system that will able to accumulate charging of batteries from DERs during off-peak hours to minimize the generation cost and battery charging cost from the main grid.In this case, FC and MT generation is kept on least priority to minimize generation cost or it can be used when demand increases.Seasonal battery sizing will become essential in designing and managing electric vehicle (EV) charging infrastructure for different load patterns of the year [14].This proposed model will help in the advancement of MG with the increasing adoption of EVs.Few studies have examined and explored gridconnected MG system optimization using machine learning techniques until now [15].Researchers choosing an MG system for their sizing and scheduling might utilize the assessment presented in this case study as a useful reference for their future work.
The main contribution of this research is: i) the optimal generation scheduling of DERs for 24 hours a day is analyzed.The optimal seasonal battery size, total cost (TC) minimization of the system, and reduction in the cost of battery charging are also estimated and ii) the performance of the grid-connected MG system is examined and compared using the ensemble learning technique based on RF, meta-heuristic technique based on particle swarm optimization (PSO), and artificial neural network (ANN) for different seasons of the year.
The paper has been organized in the following sections.Section 1 explains the introduction of the research work.The description of the main computational method is covered in section 2. Section 3 presents the proposed MG system and problem formulation for the evaluation.In section 4, the comparison and analysis of the outcomes from various methodologies are presented.The conclusion is covered in section 5.

RANDOM FOREST METHOD
The RF learning model is a powerful and widely used machine learning algorithm that belongs to the ensemble learning family.It is particularly effective in both classification and regression tasks and has gained popularity due to its ability to provide accurate predictions and handle complex datasets.RF is based on the concept of decision trees, which are tree-like models that make predictions by partitioning the input space into regions and assigning a class or value to each region.RF combines the predictions of multiple decision trees to make more robust and accurate predictions.Instead of relying on a single decision tree, it creates an ensemble of decision trees, where each tree is trained on a different subset of the training data and features [16].Randomness is introduced in two ways: random sampling of the training data and random feature selection.During the training process, each tree is trained on a bootstrap sample of the original training data, which means that some instances may be repeated and others may be left out.This sampling technique is known as bagging.Furthermore, at each node of a decision tree, RF only considers a random subset of features for splitting, rather than using all available features.By doing so, RF decorrelates the decision trees, reducing their tendency to make similar predictions and increasing the diversity within the ensemble.To make predictions, RF aggregates the predictions of all the individual trees.In regression tasks, it takes the average or the median of the predicted values from all the trees [17].Recently, the RF model is used in the optimization of microgrids to improve the performance and stability of the system [14], [18].The mean squared residual at the node is a common splitting criterion in the context of regression if the response values at the node are  1 ,  2 . . . . .  .
) 2  (1) Where   is the number of elements at node and  = is the estimated values of each node object.A common splitting criterion 1, . . in the context of regression, where  classes are denoted, is the Gini index.
Where ̂ is the proportion of observations of class  in the node.Figure 1 shows the layout of the RF method.
Figure 1.RF model The steps used for creating the RF approach there are: a. Generation Step I: take bootstrap sample  1 ,  2 . . . .  of size  from test data.
Step II: required parameters: i) number of trees   ; ii) variables that are separated at each split in number   .Breiman proposes a general formula for this parameter   =  2 ( + 1); and iii) size of minimum is given by   .Here, number of trees,   =500, number of candidate variables in each split=3, minimum node size=2.b.Construction For  = 1 to Step III: use the bootstrap sample  1 ,  2 . . . .  .
Step IV: the following steps should be repeated recursively for each terminal node of the tree until the minimal node size   is attained in order to grow a RF tree ( 1 ,  2 . . .  ) to the bootstrapped data.i) Choose  predictors at random from the  available predictors.ii) Choose the most suitable variable or split point  from those from step (i) based on the Gini index.
iii) Using the split from step (ii), divide the node into two descendant nodes.c.Prediction Step V: to make a prediction at a new point .i) Each decision tree creates its own unique prediction  1 ,  2 , . . .  for the nth RF tree.
ii) The final forecast is determined by averaging the predictions (using regression).

PROPOSED MG SYSTEM
A proposed grid-connected microgrid with DERs (solar photovoltaic (PV), wind turbine (WT), FC, and MT) is shown in Figure 2. BESS are used in conjunction with DERs to maintain stability in the system [19]- [23].The power generated from DERs is used to supply power to alternating current (AC) loads such as commercial, industrial and residential.

Problem formulation
The main objective of this paper is to evaluate: i) MG system's total system cost (TSC); ii) to achieve the optimum battery size; and iii) to determine reduction in cost of battery charging.The proposed challenge is presented as a multi-objective optimization problem.The objective function is comprised of the costs of the following items: i) the cost of the solar PV system ( Where   ,   ,   are coefficients of the  ℎ thermal producing units at time ,    () is the  ℎ generator's output power at time ,   () cost of start-up of  ℎ generator at time and   () is binary variable showing the thermal unit's commitment condition at time .The constant operational and maintenance cost of dispatchable and non-dispatchable units are: The price of batteries includes both the initial, fixed cost (FC)  , and continual maintenance and repair (MC)  , costs.The cost of installed batteries may be calculated using: Where  , is maximum size of battery and  is interest rate for installing batteries.The following equations represent the functions of power purchase cost and power selling revenue: Where   () and   () are cost of power purchased from the grid and sold to the grid in Rs/MWh.

. Data and generation analysis
In this case the real-time load data of Bengaluru City (Karnataka, India) for various seasons of year 2022 i.e., from January 1 st , 2022, to December 31 st , 2022, is considered [24], [25].Figure 3(a) shows the monthly average of 24-hour load demand for different seasons.Figures 3(b) and (c) shows the solar radiation (SR) and wind speed for 24 hours considered for the generation of solar energy and wind energy for MG operation.Figure 3(d) shows the main grid buy and sell price of variable load for 24 hours.It is considered for different energy sources of MG also.The optimal power generated from solar PV, WT, FC, and three MTs is shown in Figures 4(a

Result analysis
The optimal total power generation obtained from PSO, ANN, and RF methods is depicted in Figure 5. From Figure 5(a) it can be seen that as compared to PSO, RF generates the majority of power during the winter, whereas ANN produces the least power.As a result, a larger battery size is required when the ANN approach is used.The weather and temperature changes are more responsible for the load variations in the spring and autumn season.Therefore, as shown in Figure 5(b), the maximum and lowest generation for RF and ANN varies across spring and autumn.The electricity demand also rises throughout the summer due to the hot and humid conditions as a result it becomes challenging to match the load demand during peak hours.Figure 5(c) demonstrates that RF produces the maximum energy and satisfies the load demand, whereas ANN produces the least.Maximum and minimum generation for RF and ANN change during the monsoon season as shown in Figure 5(d).Therefore, when PSO and ANN approaches are applied to the suggested MG system, the requirement for battery sizing is more, while it is lower when compared to RF technology.Table 1 compares the analysis of power generation and surplus electricity sent to the grid using various methodologies.
From comparative analysis, it can be seen that RF approach produces maximum excess power generation resulting in more savings in generation cost.

Battery charging analysis
Figure 6 depicts the optimal battery charging and discharging state when various techniques are implemented in the proposed MG system.As seen in Figures 6(a) to (d), the most effective time to charge batteries using DERs is from 12:00 PM to 6:00 PM i.e., during off-peak hours.The FC and MT are kept on the least priority when RESs are not able to fulfill load demand and battery charging.Since at peak hours, the cost of charging batteries will also increase and scheduling of batteries will also become a tedious job.Therefore, battery charging during off-peak hours will lower the price and burden on MG.In the winter season (Figure 6(a)), the load demand is minimal therefore less battery capacity is required whereas in the summer season (Figure 6(c)) the load demand increases which increases the requirement of battery capacity also.In the summer season, as load demand is maximum, therefore FC and MT generation power is also required.

Cost analysis
Table 2 gives the statistical analysis of the cost comparison between various techniques applied to the MG for various seasons.In the winter season, the load demand is minimal, therefore generation cost is also minimum.But in the summer season, the requirement of maximum power arises which increases the generation cost also.It can be seen from Table 2 that DERs with battery systems can able to meet the required load demand in winter, spring autumn, and monsoon season.This will reduce the heating cost and hydrogen costs resulting in maximum overall savings in the proposed MG system.In this system, the excess power left can be further used in EV charging or storing power in the battery (charging).During the winter season cost is minimum whereas in case of summer season cost increases with an increase in demand.

Seasonal battery size analysis
The research also focuses on the estimation of optimal battery size for all seasons.The annual revenue spent on the battery size is minimal when all the DERs are considered for optimization.The optimal battery size obtained from various techniques for various seasons is depicted in Figure 7.The comparison shows that seasonal battery size estimated using the RF method gives better outcomes when compared with ANN and PSO techniques.Thus, the findings demonstrate the optimal battery size, reduction in battery charging cost, and cost of total power generation accomplished through the RF approach delivers the most beneficial results as compared to ANN and PSO.

CONCLUSION
Microgrids can offer dependable and affordable power to communities while lowering carbon emissions and boosting grid resilience by using the advantages of DERs.They can smoothly integrate with the current utility grid, enabling the two systems to operate together in harmony by using modern control algorithms and communication technology.This will allow future expansion as well as smooth integration of plug-in hybrid electric vehicles.In this paper, a case study using real-time load data of various seasons is taken for the multi-objective optimization of DERs based MG using ensemble learning-based RF model.The results show that optimal battery size, reduction in battery charging cost, and total cost of the proposed MG system with DERs are minimal in the case of the RF model.

Figure 5 .
Figure 5. Optimal total electrical power generation using PSO, ANN and RF for different seasons: (a) winter season, (b) spring and autumn season, (c) summer season, and (d) monsoon season

Figure 6 .
Figure 6.Optimal battery charging and discharging state for PSO, ANN and RF for different seasons: (a) winter season, (b) spring and autumn season, (c) summer season, and (d) monsoon season

Figure 7 .
Figure 7.Comparison between optimal battery size for different seasons This section exemplifies the objective function and its associated constraints.
), cost of WT (   ), total cost of FC and MT (   and    ), and cost of BESS (   ); ii) the cost of operation and maintenance    ; iii) the cost of generation    ; and iv) the cost of buying and reselling power from/to the grid,    and    for time  in Rs/MWh.  , +   ) +  , ( , −  ,−1 ))  =1

Table 1 .
Comparative analysis of power generation for different seasons

Table 2 .
Comparative analysis of cost for different techniques