Optimal Day-Ahead Scheduling and Operation of the Prosumer by Considering Corrective Actions Based on Very Short-Term Load Forecasting

Energy management systems (EMSs) play an important role in the optimal operation of prosumers. As an essential segment of each EMS, the load forecasting (LF) block enhances the optimal utilization of renewable energy sources (RESs) and battery energy storage systems (BESSs). In this paper, a new optimal day-ahead scheduling and operation of the prosumer is proposed based on the two-level corrective LF. The proposed two-level corrective LF actions are developed through a very precise short-term LF. In the first level, a time-series LF is applied using multi-layer perceptron artificial neural networks (MLP-ANNs). In order to improve the accuracy of the forecasted load data at the first level, the second level corrective LF is applied using feed-forward (FF) ANNs. The second stage prediction is initiated when the LF results violate the pre-defined criteria. The proposed method is applied to a prosumer under different cases (based on the consideration of BESS operation behaviors and cost) and various scenarios (based on the accuracy of the load data). The obtained optimal day-ahead operation results illustrate the advantages of the proposed method and its corrective forecasting process. The comparison of the obtained results and those of other available ones show the effectiveness of the proposed optimal operation of the prosumers. The advantages of the proposed method are highlighted while the BESS costs are considered.

INDEX TERMS load forecasting (LF), multi-layer perceptron artificial neural network (ANN-MLP), optimal operation and scheduling, prosumer, battery energy storage system (BESS), renewable energy sources (RESs). The difference between the measured and forecasted load data x i Input at the i th node of the input layer Net h j Net value at the i th neuron of the hidden layer wh ji Connection weight of the j th neuron with the j th input bh j Weight of the bias at the j th neuron of the hidden layer h j Output of i th neuron of the hidden layer Net (y k ) Net value at the k th neuron of the output layer wo kj Connection weight of the j th hidden layer neuron with the k th hidden layer neuron bo k Weight of the bias at the k th neuron of the output layer y k Output of the k th neuron of the output layer Index of the node of the input layer j Index of the neuron of the hidden layer m Index of optimal operating scenario p Index of load pattern k Index of the neuron of the output layer q Index of the time interval Electric power systems and energy markets are facing changes such as redesigning and restructuring due to the utilization of renewable energy sources (RESs) and the deployment of communication technologies (blockchain, big data, and internet of things (IOTs)). The formation of prosumers in emerging energy markets is another critical change in conventional power systems. Prosumers are energy units that can consume and produce energy through the use of RESs. However, the role of prosumers in electric power systems are generally insignificant, and they are suffering from immature energy business models [1]- [4].
Recently, the design of the new energy markets to increase the integration of prosumers in the electric power system has been highlighted. For instance, the clean energy package by the European Union discussed the rules for prosumers in energy markets and let active consumers produce electricity as well as electricity sales [5]. In such energy markets, the heart of the system is consumers. They would be able to generate electricity by RESs and get their profits by selling the amount of produced electricity [6]. However, due to low feed-in-tariffs (FiT), prosumers may not enjoy the ideal economic benefits of the market [7].
Peer-to-peer (P2P) communities are the other options for prosumers, which enable the prosumers to directly sell their produced renewable energy to local consumers [8], [9]. In order to achieve maximum economic benefits, prosumers need to operate in optimum operation mode. Hence, the key component of each prosumer unit is the energy management system (EMS), which schedules the RESs and energy storage systems (ESSs) [10]. As a major block of EMS, the LF module plays an essential task in the optimal utilization of RESs and the profitable trade-off with the utility grid [11].
The LF in prosumer microgrids is quite different from the conventional power system because the variation of the loads during a day is much significant due to its smaller load size [12]. Moreover, there are less similar daily load curves which makes it challenging to forecast load profiles. There are different kinds of LF methods, namely, very short-term, short-term, medium-term, and long-term. The very detailed information about different LF methods can be found in [13]. However, the very short LF is used because most of the prosumers' activities occur in hourly and minutely cycles [13].
Generally, the LF is achieved by using the previous load data to forecast the coming day or week load profiles. Conventional LF methods, such as grey theory and linear regression methods, have been applied in the literature [14], [15]. These methods are based on simple structures and have mature technologies. However, due to their linearity basics, it is quite difficult for conventional methods to forecast the prosumers' nonlinear load series [16]. Due to recent achievements in computational intelligence (CI), several studies applied intelligent-based methods such as fuzzy systems and artificial neural networks (ANN) for their short-term LF [17][18][19][20]. Since fuzzy logic systems are appropriate to consider the uncertainty of load profiles, various studies have applied different methods of fuzzy inference systems to forecast load profiles. However, fuzzy inference systems are not desirably accurate, which make them inadequate in the short-term LF with high accuracy. On the other hand, the learning ability, robustness, and the nonlinear approximation property of typical ANN make them a suitable tool for short term LF. However, because of the effects of the threshold parameter and initial weighing factor, conventional methods of ANN converge with slower speed, and their forecasting accuracy is reduced [16].
The literature is reached with different methods of shortterm and very short-term LF for prosumer microgrids, which are merely focused on their forecasting method [21]- [23]. In another mean, they have not applied their LF method on the real day-ahead operation of the prosumer microgrids. The CIbased methods have shown significant progress and accuracy in this type of studies. In particular, ANN methods have received a great deal of attention because of their superior learning and nonlinear mapping abilities [23]. Various ANNbased forecasting approaches such as multi-layer perceptron (MLP) ANN [19], deep neural network deep-energy [21], and bat algorithm-based backpropagation [24] have been presented in recent studies. In addition, time-series forecasting methods have been interested in previous works. Time-series forecasting is achieved by predicting future values based on the formerly recorded values. The role of time-series forecasting is significant in nonlinear systems. Although timeseries forecasting is discussed in theoretical research fields, it has engineering applications, too. The time-series LF has been performed in literature by using different CI-based methods namely fuzzy time-series [11], [25] and ANN times series [26], [27]. However, most of the research works in literature have not considered any corrective algorithm for the time-series forecasting results [11], [16], [25]- [27].
In some studies, the optimal scheduling and operation of prosumers with no LF application have been developed [28]- [31]. Choi and Min [28] proposed the optimal scheduling of ESSs in a day-ahead operation of a prosumer. They have performed a real-time corrective operation for prosumers by using ESSs. However, the LF technology did not exist in their proposed EMS. In another study, authors of [29] introduced a day-ahead operation of prosumers with interconnected energy sources. In order to indicate the negative effects of RESs, uncertainties such as fluctuations and intermittence of RESs have been considered. Although they have regarded the uncertainty of RESs, there was no analysis of the effects of load changes in the proposed system. Researchers in [30] proposed a new day-ahead optimization model for a residential prosumer, which was equipped VOLUME 8, 2020 with RESs and electric vehicles (EVs). The proposed model minimized the total operation cost of the prosumer, such as electricity generation and EV wearing cost. Moreover, they have considered the uncertainty of EV, load demand, and RESs through the optimization process. The optimization problem was solved using benders decomposition algorithm. According to the results of the paper, the utilization of the EV as ESS in the microgrid decreased the system operation cost. Despite the consideration of the load uncertainty, the paper has not suggested any methodology for forecasting purposes. Qiu et al. [31] presented a new method for optimal interactive operation of prosumers with two energy systems, e.g. gas and power systems. The proposed model maximized its profits from the optimal scheduling of DERs and unit commitments. The authors stated that the proposed two-level coordinated scheduling would result in the optimal and accurate operation of prosumers.
To the best of the authors' knowledge, there are few studies in the literature that have been considered short-term LF in day-ahead optimal operation of prosumers [32]- [35]. Yuewen Jiang et al. has considered a two-level decision model for a prosumer, which benefited from RESs and ESSs. In the first level, monthly electricity purchases were optimized, and in the second level, day-ahead uncertainties such as electricity prices and economic risks were considered. The paper also performed the optimal scheduling of ESSs to maximize monthly economic benefits. Moreover, the paper utilized forecasted wind speed, electricity price, and load data in the optimization method. However, the paper has not suggested any methodology on the prediction process and the accuracy of the prediction.
A simple short-term LF method is proposed in [33] for arbitrary EMSs. The proposed method did not require many inputs, such as weather data. The only requirement was electrical load data, which could be achieved from the smart meters. However, the paper did not provide economic and technical benefits of the proposed model in real application of home EMS. In [34], Sun et al. proposed a method, which included both energy management of prosumer and shortterm LF. The EMS was developed based on the economic performance and regular operation of battery storage. They used neural radial basis function artificial neural network (RBF-ANN) for short-term LF. The effectiveness of the proposed method was shown through simulation results. In another study, Iwafune et al. [35] performed the short-term load and PV output forecasting using multiple linear regression (MLR) and support vector regression (SVR) in their proposed EMS, respectively. According to the test results, the optimal operation of ESS has reduced the system operation cost. Moreover, the system operation cost has not been improved by using the forecasted data with their proposed model.
In Table 1, the available related research works are divided into three general categories. In the first category, the methods have been focused on the short-term LF. In the second category, the concentration of scientific works was in optimal scheduling and operation of the microgrid prosumers.
However, in the third category, a few of the papers were concentrated on the optimal operation of prosumers considering short-term LF methods in their studies.
In this paper, a new very short-term LF model is proposed by using the ANN and data-driven approaches. The proposed model is a two-level LF. The first level starts with a very short-term LF using MLP-ANN time-series. In the second level, in order to improve the accuracy of the forecasting, the forecasted values of the first level are evaluated based on the pre-defined prediction violation. Whenever the forecasted values are adequately precise, the load values would be used in the optimization problem. However, due to the accuracy constraint violation, another corrective forecasting model based on the load patterns of the previous 30-days period would be applied to improve forecasting results. The feed-forward ANN (FF-ANN) is utilized in the second level to find the best load pattern based on the previous days' load patterns. Finally, the proposed LF is implemented to the dayahead operation of an industrial prosumer.
The main contribution of this paper is proposing a new corrective LF within the optimization of the prosumer operation costs. The use of the FF-ANN in the second level LF in addition to the first level time-series-based LF is one of the most important advantages of the proposed method.
The prosumer understudy is assumed to be contracted to provide the electricity to the consumer during particular periods. Different case studies are considered to investigate the effectiveness of the proposed LF model in the day-ahead operation of the prosumer. The optimization results have shown that by applying corrective actions on the first level LF, the accuracy of the prediction is enhanced. By using the proposed corrective actions through the LF and optimization, the prosumer operation cost is decreased. The comparison of the test results with other available ones without corrective LF or with one-level LF illustrates the advantages of the proposed method.
The rest of the paper is structured as follows. In Section (2), the proposed day-ahead optimization method based on a new two-level very short forecasting is stated. In Section (3), LF results include proposed Level-1 and Level-2 LF are presented. In Section (4), the optimization results based on the proposed corrective LF are presented. The conclusion is given in the final section.

A. THE ARCHITECTURE OF THE SYSTEM
The prosumer is equipped with RESs such as photovoltaic (PV) and wind turbine (WT) DG unit as shown in Fig. 1. For economic purposes, the BESS has also been utilized in the architecture of the system. The prosumer is contracted to provide a specific amount of the demand load of neighbor's consumers during particular hours of the day. The prosumer is connected to the national utility grid. Thus, the prosumer can purchase the required demand power and also sell the surplus amount of RESs generation or the stored power of  BESS. The prosumer benefits from the energy traded between the grid and consumers. Moreover, consumers also advantage from lower energy imported by the prosumer. However, due to variable peer-to-peer electricity prices, the profits from energy selling to consumers have not been considered in the optimization model. The utilized EMS guarantees the optimal operation of the prosumer.

B. THE PROPOSED METHOD OF OPTIMAL OPERATION AND SCHEDULING OF PROSUMERS BASED ON THE SHORT-TERM LF AND VERY SHORT-TERM CORRECTIVE ACTIONS
In this paper, the operation and scheduling of the prosumer are optimized by using the short-term LF and very short-term corrective actions. The short-term LF data could be used for optimizing the operation and scheduling of the prosumers. Moreover, by adding the real-time assessment of the forecasted load values and the measured ones, it is possible to reoptimized the system operation strategies. Through applying the day-ahead optimal operation strategies, it is possible to experience a significant error in the LF procedure. Hence, the system operation cost is affected due to the discussed inaccuracies in the forecasted load data. It is interesting to perform some corrective actions to avoid this subject. By applying the proposed method based on the real-time measurement of the load data, the modified very short-term LF and finding the modified optimal operation strategies based on the modified forecasted input data decrease, the system operation cost of the prosumer would be decreased.
In this section, the proposed two-level LF, which is used in the optimization of the prosumer's operation cost, is explained. In the proposed two-level LF, an MLP-ANN time-series algorithm is used to implement the short-term LF on the first level. The first level LF is sufficient, while the accuracy of the LF is satisfying based on the comparison of the measured and forecasted load data. The second level of the proposed LF is started when the LF accuracy is less than the desired level. In Fig. 2, the starting procedure of the second LF and its structure have been shown. The literature review of LF using ANNs shows that the MLP ANN is more accurate and useful than other neural networks such as well-known radial basis function (RBF) ANNs in short-term load forecasting [36], [37]. In [36], different ANNs for short-term LF on four datasets have been compared. The RBF-ANN, MLP-ANN, generalized regression ANN, three models of self-organizing map (SOM), and two models of fuzzy counterpropagating ANNs were studied in [36]. Based on the comparison test results, it was reported in [36] that MLP and generalized regression ANN have identical performance and accuracy for all input data. It was also concluded that the performance of MLP-ANN was better in comparison with other state-of-art methods and classical models such as exponential smoothing and autoregressive integrated moving average (ARIMA) approaches. Hence, MLP-ANN is used in the proposed method for LF. This paper focuses on corrective actions based on very short-term load forecasting. However, it should be noted that despite the advantages of RESs in the energy systems, uncertainties in the output of RESs bring challenges in stability and reliability to the energy systems [38]. In the prosumer's day-ahead operation, neglecting uncertainties of RESs output power would increase the system operation cost [39]. The corrective actions based on renewable energy forecasting in the scheduling and operation of prosumers help to reduce the system costs. Although this study has not considered corrective actions based on renewable energy forecasting, the proposed method is flexible for adding this paradigm. The development of optimal scheduling and operation of prosumers using corrective actions based on renewable energy forecasting is one of the authors' future works. The uncertain parameters, e.g. output power of renewable energy resources and load curves, could be forecasted in the first level of the proposed method. Similar to the load forecasting, the historical data of PV and WT DG units output power are used for time-series short-term renewable energy forecasting by an appropriate forecasting method such as MLP-ANN. In the second level, the forecasted renewable energy output similar to forecasted load data is compared to the actual measured values. Afterwards, based on the accuracy thresholds, real-time corrective actions are applied. Therefore, the proposed model for the optimal day-ahead operation of the prosumer could be developed by renewable energy forecasting as a practical innovation.

1) LEVEL-1 LF: MLP-ANN TIME-SERIES METHOD
In the first level, a day-ahead LF is applied using timeseries MLP-ANN method. Time-series forecasting usually is performed using delays in the input data. The structure of the time-series MLP-ANN method is based on hierarchal processing units that are ordered in two or more series of distinctive layers of neurons. The historical data is imported to the ANN through the input layer (IL). The input data of Level-a LF is a matrix with dimensions 1 × 8760 of historical load data as (1): The mapping process of input data is done in the output layer (OL) [40]. In this paper, the Levenberg-Marquardt backpropagation algorithm (BPA) is applied for learning the MLP. The error between target and input values are minimized in Levenberg-Marquardt BPA. Fig. 3 illustrates the architecture of the MLP-ANN. As can be seen, the MLP consists of three layers. In the first layer, IL is located, which is a set of source nodes. In the second layer, one or more hidden layers (HLs) are located, and OL is located in the third layer. The number of nodes in IL and OL directly depends on the number of input and output variables. The calculations of MLP output is described as follows [41,42].
At the j th HL neuron, the net value is calculated as (2). The output of the i th HL neuron is calculated by using (3).
At k th OL neuron, the net value is calculated as (4): Moreover, the k th OL neuron is calculated, as shown in (5).
In the first layer, a typical MLP-ANN with three hidden layers is applied for time-series-based short-term LF. The measurement at time (t−24) was used to predict the electrical load at time (t+24). In addition, 70, 15, and 15 percent of samples were taken for training, validation, and testing, respectively.

2) LEVEL-2: THE PROPOSED CORRECTIVE VERY SHORT-TERM LF
In the proposed method, Level-2 ANN forecasts the upcoming load profile using the data of the previous 30 days load profiles. The types of inputs for feedforward MLP-ANN in Level-2 are different from the MLP-ANN time-series LF in Level-1. Hence, the better accuracy of LF could be achievable by Level-2 while the MLP-ANN time-series LF has not the desired performance due to unknown events. On the other hand, it is desired to perform one day-ahead scheduling for the whole day. Hence, most of the time, the adequately precise LF is achievable by Level-1 LF, and in some cases due to some reasons, Level-2 LF modifies the accuracy of the LF and the prosumer operation costs. By applying the proposed two-level LF-based optimal scheduling and operation of prosumers, the advantages of very short-term LF is achievable while fewer LFs and solving the optimization problems are needed. By decreasing the forecasted period in Level-2 LF instead of 24-hour forecasting period of the Level-1 LF, the better performance of the forecasting would be expected. VOLUME 8, 2020 According to the proposed two-level LF method, the measured and forecasted load data are compared together in determined intervals as described in (6).
The difference between the measured and forecasted load data is checked by a specified LF accuracy threshold as (7). While the accuracy of the LF is satisfying based on (7), the prosumer is scheduled and operated by using the optimization results according to the first level LF data. However, the second corrective LF is started when the discussed difference exceeds the pre-defined threshold.
In the proposed two-level LF-based optimal scheduling of prosumers, the Level-2 LF applies corrective actions for future time steps. For instance, as can be seen in Fig. 2, at the end of the first and second interval times (t 0 -t 1 and t 1 -t 2 ), the Level-1 LF data are compared with the actual measured values. In these times, the accuracy of the LF is desirable. Hence, corrective actions and the level-2 LF are not applied. At the end of the third interval time (t 3 ), the comparison of the Level-1 LF data and the measured values indicates that the accuracy of LF is not satisfying. Accordingly, the level-2 LF and corrective actions are applied for the fourth time step and other next time steps.
In the proposed method, the optimization problem, as defined in (12)(13)(14)(15)(16)(17)(18)(19), is solved based on the Level-2 LF data. It means the constraints (as (13)(14)(15)(16)(17)(18)(19)) are concerned to obtain corrective actions according to the modified optimal scheduling and operation of the prosumers. The constraint of the BESS's final SOC at the end of the day is satisfied when corrective actions are applied.
The proposed corrective LF has been developed based on the data-driven approach. The Level-2 ANN forecasts the upcoming load profile using the previous 30 days load profiles as input (Fig. 2a). In Level-2 LF, a set of load patterns are given to the input of the FF MLP-ANN. The input data is a matrix, which indicates hourly load data for the previous 30days period. The number of columns is fixed and assumed to be 30 because of selecting a historical 30-days period. The number of rows depends on the starting time of Level-2 LF (the q th time interval of the operating day). The input matrix of Level-2 LF can be defined as (8).
If the modified values of the forecasted load data are adequately precise, they would be used for solving the reoptimization process. Otherwise, the proposed Level-2 LF once again forecasts the upcoming load profile using the previous 30 days load patterns as input. In this level, instead of using the time-series-based LF method, FF MLP-ANN is used for finding the best load pattern.
The inputs are the data of the previous 30-days period, and the target values are the measured hourly load data. The flowchart of the proposed very short-term LF is illustrated in Fig. 4. The results of MLP-ANN time series-based have been evaluated by statical criteria such as mean squared error (MSE), root mean squared error (RMSE), and standard deviation (STD) as described in (9)(10)(11). Moreover, the regression results of forecasting results have been depicted to have a better understanding of forecasting accuracies [43]- [45].
In Level-1 LF, a time-series based MLP-ANN is used for day-ahead LF of the prosumer. The time-series MLP-ANN performs the LF based on the delayed inputs of the algorithm. However, in Level-2 LF, instead of using a time series LF, FF-ANN, which collects a set of load pattern as the input of the algorithm is used. This is mainly because of the effectiveness of FF-ANN for load pattern recognization. In FF-ANN, a set of previous load patterns (loads of previous 30-days period) is used for training the ANN, so the accuracy of the LF would be significantly improved. The decrease in the period of LF based on the starting time of Level-2 also helps improve the accuracy of the method.

C. THE OPTIMIZATION OPERATION OF THE PROSUMERS BASED ON THE TWO-LEVEL LF AND EMS
The following optimization problem based on the introduced objective function (O.F) in [28] as described in (12) is used in the proposed optimal operation of the prosumers based on the two-level LF and EMS.
The main purpose of the optimization problem is to minimize the operation cost of the prosumer. The cost of energy purchased from the grid is stated in the first term of the O.F. Also, the degradation of the BESS in the second term of the O.F is concerned. The degradation of the BESS is controlled by minimizing the changes in the BESS SOC. Due to the existence of a quadratic term in the O.F, the problem is solved using quadratic programming.
In the proposed method, the optimization.

1) SOC-RELATED CONSTRAINTS
The BESS SOC plays an important role in the lifetime of the batteries [46]. BESS SOC indicates the amount of available electricity in the battery. As an example, it could be compared with the fuel gauge of gasoline-based vehicles. The constant full charge and discharge of BESS will gradually degrade the BESS efficiency and lifetime. Therefore, the SOC-related constraints ignoring would result in the reduction of battery lifetime [47]. For this reason, (13) is considered to limit the variation of the BESS SOC during the day-ahead operation [48].
Generally, the SOC of BESS has a direct relation with the output power of BESS as presented in (14).
Moreover, due to the consideration of SOC limits in (8), it is necessary to consider a similar equation for the output power of BESS. As illustrated in (14), the BESS SOC and output power of BESS have direct relation. Hence, similar limits are applied to BESS output power in (15)(16).
Because the BESS has a daily operation, it is essential to have the same initial and final values of SOC. This constraint is applied in (17).

2) ENERGY BALANCE CONSTRAINT
Overall consumption and generation power of the system must be balanced. Hence, (18) should be considered as a major constraint.
The BESS output power P BSS t is positive when the BESS is discharging, and it acts as a power source. Moreover, P BSS t could be negative while the BESS is charging and it acts as a load. The P BSS t upper and lower bounds are determined according to SOC constraints.
In the proposed method, the prosumer's load P prosumer t is forecasted by Level-1 LF, and the optimization problem is solved based on the accurate values of the forecasted loads. By using the accurate load data, it is possible to reduce VOLUME 8, 2020 the prosumer's operation cost in comparison with conventional approaches use the predefined load values. Moreover, the accuracy of the forecasted load values is controlled during the prosumer's operating time. The Level-2 LF starts when the accuracy of LF is not desirable, and the optimization problem is solved again according to the very short-term LF data. It means the prosumer's load P prosumer t is forecasted to obtain more accurate values by Level-2 LF if it is needed. Improving the optimal day-ahead operation of prosumer by two-level LF and the use of more accurate load data is the most important contribution of this paper.
As described in the prosumer structure, the prosumer should provide a specific amount of the load demand load of neighbor consumers during particular hours of the day. Hence, the demand side has two parts, e.g. prosumer loads and contracted consumers. The power balance condition, including both demand loads and contracted consumers, should be met.
The imported and exported power of the system should be in the specified range of the transmission capacity, as shown in (19).

D. THE ARCHITECTURE OF PROPOSED OPTIMAL DAY-AHEAD OPERATION AND EMS
The step-by-step flowchart of the proposed optimal operation of the prosumers consists of the two-level LF and EMS is shown in Fig. 5. The proposed method is initialized with collecting historical data such as RESs generation, market electricity price, and electrical load data. Depends on the using the proposed LF levels, the optimal operation results are calculated. Finally, the system operation cost is assessed based on the optimal operation and scheduling decisions and the measured load data.

E. THE PROPOSED PROSUMER'S EMS
The steps of the proposed EMS are shown in Fig. 6. The shortage or surplus energy due to changes in the load data in comparison with the pre-defined or forecasted load data is evaluated in the proposed EMS as (20). While the value of α t,m is between the lower and upper bounds described in (21), it is necessary to adjust the power imported/injected from/to the grid as depicted in (22). In this condition, the EMS does not change the BESS-based operation decisions.
If the power shortage of the prosumer due to changes in the load data regret the forecasted load values is greater than the available power capacity (as shown in (20)), which could be imported from the grid, the power imported from the grid is set to the maximum value.
In addition, the rest of the required power is supplied by the BESS according to the EMS commands subject to BESS constraints such as maximum output power and the maximum level of SOC. Under the conditions, where have been explained in (23), the EMS would change the output values as (24)(25)(26). It should be concerned in the design of the prosumer that under all conditions, the grid and BESS could provide the required energy in the worst cases. Otherwise, load shedding is necessary.
It is possible to exceed the surplus power than the available capacity for power injection to the grid, as demonstrated in (27). The explained operation changes, which are introduced in (28-30), should be applied. The appropriate capacity of the BESS should be considered in the design and configuration of the energy system. Otherwise, the energy generation of renewable DG units is stopped due to prosumer limits.

A. LOAD ANALYSIS
In this paper, the historical load data extracted from [49], as shown in Fig. 7 has been used. The used load data belongs between 2017/12/31 to 2018/12/31. As revealed by Fig.  7, the highest load consumptions have occurred in winter and fall. However, during the spring and summer, the load consumptions have been gradually decreased. The detailed descriptions about the load profile are shown in Table 2.
As can be seen in Table 2, the maximum load consumption has occurred at fall with 245.00 kW, and minimum load consumption has occurred in summer with 169.87 kW. In addition, summer has the least average consumption with 83.62 kW, and winter has the most average load consumption during the year. 83570 VOLUME 8, 2020   Fig. 8b. The regression value for all data is 0.9976, as can be seen in Table 3, which approves the proper  Table 3. Moreover, Fig. 9 shows the linear regression results for training, validation, and testing load data.

2) LEVEL-2 CORRECTIVE LF
In the Level-2 corrective LF, the LF accuracy criterion ( P t ≤ ξ ) is evaluated as the starting condition. While the Level-1 LF accuracy is satisfying, the Level-2 corrective LF is not activated. However, when the LF error exceeds the determined threshold, the proposed Level-2 ANN forecasts the upcoming load profile using the previous 30 days load profiles as input. The modifying LF is performed based on VOLUME 8, 2020 the load data of the previous 30-days period. In this study, the desired accuracy level of the LF is selected as 2 kW (ξ = 2 kW ). Fig. 10 shows the measured and Level-1 fore- casted load patterns in a typical day (1 January 2019). As can be seen, the accuracy of the Level-1 forecasted load data in comparison with the measured value is not satisfying for the first time interval (from 0:00 to 1:00). Moreover, the differences between the measured actual and forecasted load values of the typical understudy day have been presented in Table 4. By starting the Level-2 corrective LF (at the first time interval (0:00-1:00 for the typical day), the previous 30 days load profiles are imported to the FF-ANN's algorithm. The previous 30 days load profiles from the hour of Level-2 LF starting (1:00 to 24:00) are shown in Fig. 11. The FF-ANN's algorithm collects load patterns as input values and actual load data of the operation day (30 December 2018) are set as the target of the prediction. FF-ANN's algorithm benefits  from learning ability, and it is a proper tool for finding the best load pattern. The utilized FF-ANN algorithm has 3 HLs.
Moreover, 70%, 15%, and 15% of load data are used for algorithm training, validation, and testing purpose, respectively. The Level-2 corrective LF results are shown in Fig. 12. The test results illustrate the effectiveness of the proposed Level-2 corrective LF. Fig. 13 shows linear regression results for the actual and previous load data of the previous 30days period. The improvement of the LF accuracy by using the proposed two-level LF method is evident. These accurate forecasted values are used for the day-ahead optimization problem.

IV. OPTIMAL OPERATION RESULTS BASED ON THE PROPOSED TWO-LEVEL LF UNDER VARIOUS CASES AND SCENARIOS
The selected system for applying the proposed optimal operation has been assumed to be equipped with RESs and BESS.  The test system has bidirectional power flow with the utility grid. Fig. 14 shows the assumed RESs output power in the optimization problem. Furthermore, the prosumer has contracted to consumer neighbors to supply overall 200 kW power during two hours (17:00 to 18:00). More details on BESS and utility grid specifications are available in Table 7. Electricity price is also considered according to south Korean electricity tariff, which is based on time-of-use (TOU) pricing [28]. Table 8 shows the values of hourly electricity tariff.
The performance of the proposed method has been studied for only one-day evaluation because the proposed method focuses on the optimal day-ahead operation and scheduling of the prosumers. It is possible to study for more evaluations than one-day one in the paper. However, since the  optimization problem is solved every day, the results of the next day are independent of the previous understudy day ones.
MATLAB 2014 and GAMS 27.3.0 software are used for LF and solving the optimization problem. The CPLEX solver has been used for solving the quadratic problem. A 64-bit private computer with 8 GB RAM and Intel Core i5 CPU has been used for required computations.

A. CASE STUDIES AND SCENARIOS
In order to investigate the effectiveness of the proposed optimal operation of the prosumers based on two-level LF, two cases have been presented as follows: Case 1: without consideration of the BESS operation costs (W = 0) Case 2: By consideration of the BESS operation costs (W = 66) In case 1, the impacts of BESS SOC changes on the prosumer operation costs are neglected because the weighting coefficient in the O.F (12) has been considered as zero (W = 0). Also, in case 2, the coefficient value of the BESS SOC changes (W) is crucial to determine the optimum results. By selecting the higher values for W, the prosumer intends to use less than the BESS. Therefore, the system operation cost increases due to this strategy. On the other hand, the very low values for W result in the accelerated aging of the BESS.
The appropriate value of W should be determined according to a trade-off between the total system operation cost and the loss of life cost of the BESS. In this paper, the value of the weighting coefficient corresponding to the BESS SOC changes has been selected by using the sensitivity analysis. The sensitivity analysis results showed that by selecting the value of 66 for W, the best condition is achieved while the system operation cost and the loss of life costs of the BESS have been minimized simultaneously.
The day-ahead optimal operation of prosumer under various LF scenarios is studied: -Scenario 1: The optimal operation of the prosumer without any LF like [28].
-Scenario 2: The optimal operation of the prosumer based on ideal forecasted load data (100% accurate values).
-Scenario 3: The optimal operation of the prosumer based on Level-1 LF.
-Scenario 4: The proposed optimal operation of the prosumer based on two-level LF.
In Fig. 15, the test results of the proposed optimal operation under scenario 1 and case 1 have been shown.
The comparison test results of Fig. 15a shows a significant difference between the pre-defined load data for solving the day-ahead optimization problem and the measured data. This comparison infers that the system operation cost would be increased in comparison with the optimum condition. Due to the changes in the load data regret the input data of the optimal operation day-ahead scheduling, the operation strategies and control variables such as the power imported/injected from/to the grid (P BESS t ) are affected. Since the differences between the pre-define load curve and the actual measured data are not greater than the available transmission capacity with the grid, the BESS scheduling is not affected. The prosumer operation cost under case 1 and sce-nario1 based on the EMS rules to adjust the day-ahead planned operation parameters is equal to 137.2162 USD.

2) CASE 1-SCENARIO 2
In scenario 2, it has been assumed that the 100% accurate LF data is available. Hence, the optimization problem for the day-ahead scheduling of prosumer is solved based on the measured load data (December 31, 2018) as an ideal condition. The optimal operation test results of the prosumer such as imported/injected power to/from the grid (P s t ), the output power of BESS (P BESS t ), and BESS SOC are shown in Fig. 16. Generally, the system behavior under scenario 2 is similar to VOLUME 8, 2020  system operation cost under scenarios 1 and 2 implies that 1.18% increase in the system operation cost has occurred 83576 VOLUME 8, 2020   due to inaccurate load data. The test results illustrate that by the more accurate forecasting process for uncertain variables, the better operation and schedule is achievable.

3) CASE 1-SCENARIO 3
In this case, MLP-ANN time series forecasting load data has been used for optimal day-ahead scheduling of prosumer. Fig. 17 shows the optimal prosumer operation results. The system operation cost under case 1 and scenario 3 is 135.8862 USD. As revealed by test results, the system operation cost under scenario 3 has been decreased in comparison with that of scenario 1. The decrease in the system operation cost under scenario 3 highlights the effectiveness of the proposed optimal operation of the prosumers based on accurate LF. Moreover, the difference between the system operation cost under scenario 3 (the one-level LF-based optimal operation) and scenario 2 (ideal and 100% accurate LF) is less than 0.2%., which approves the effectiveness of the proposed LFbased method for operation optimization of the prosumers.

4) CASE 1-SCENARIO 4
In Fig. 18, the test results under case 1 and scenario 4 have been demonstrated. The comparison results of the measured and the forecasted load data based on the proposed two-level LF emphasizes the accuracy of the proposed method.
Because of the adequately precise LF by using the proposed two-level LF, including the corrective actions, the changes in the load data and its uncertainties cannot affect the system operation and scheduling. The system operation cost under scenario 4 is 135.7020 USD. The difference between the system operation cost under scenario 4 and the ideal condition (scenario 2) is approximately zero. The advantages of applying the proposed two-level LF-based optimal operation of prosumers have been highlighted by comparisons of the system operation costs under various scenarios.
To concern the BESS operation cost, it is possible to add some terms regarding the BESS SOC as introduced in [28]. Under case 2, the BESS operation cost has been concerned. In addition, the effectiveness of the proposed optimal operation of the prosumers based on accurate LF could be examined in the viewpoint of BESS operation cost considerations. In this paper, the weighting coefficient of the SOC terms in the O.F is assumed to be 66 under case 2.

C. CASE 2
To concern the BESS operation cost, it is possible to add some terms regarding the BESS SOC as introduced in [28]. Under case 2, the BESS operation cost has been concerned. In addition, the effectiveness of the proposed optimal operation of the prosumers based on accurate LF could be examined in the viewpoint of BESS operation cost considerations. In this paper, the weighting coefficient of the SOC terms in the O.F is assumed to be 66 under case 2. The day-ahead optimal operation of the prosumer under case 2 and scenario 1 is very similar to case 1 and scenario1, except the considering of the BESS operation cost. In Fig. 19, the test results of the optimal operation of the prosumer under case 2 and scenario 1 have been shown.
The comparison of the test results of case 1 and 2 under scenario 1 illustrates the impacts of the BESS operation cost. Because of the SOC-based term of the O.F, the variation of the BESS SOC under case 2 is less than case 1.
Similar to the previous case study, the historical load data of previous years' (31 December 2017) has been selected to import the optimization problem. No EMS and LF have been considered in this case. The operation cost of the prosumer is achieved as 158.1011 USD. By comparison of the system operation costs for scenario 1 under cases 1 and 2, it can be inferred that 15.2% increase in the operation costs has occurred due to the BESS operation and LOL cost. It means the studies under case 2 are more accurate than those of cased 1.
The operation results under case 2 and scenario 1 are shown in Fig. 19. The BESS does not charge or discharge, consecutively. A smooth behavior of BES is observed through the operation horizon under case 2 because of the BESS term consideration in the OF.

2) CASE 2-SCENARIO 2
The actual load data is used to solve the optimization problem. The operation cost under case 2 and scenario 2 would be 147.6629 USD. The optimal operation results of prosumer are depicted in Fig. 20. As expected, the battery is not consecutively charged or discharged, which increase the battery lifetime.
The comparison of the test results under scenario 1 and scenario 2 (ideal condition based on the load data) shows 6.97% increase in the prosumer operation cost due to the inaccurate load data.
By comparison of the test results of scenario 1 and 2 under different cases, it could be concluded that due to the consideration of the BESS LOL and operation costs, the impacts of inaccurate load data are highlighted. Under case 1, about 1% difference exists between the operation cost for scenarios 1 and 2, while under case 2, this difference is more than 6%. It means that the impacts of accurate load data and LF are highlighted due to the BESS operation costs.

3) CASE 2-SCENARIO 3
Under case 2 and scenario 3, the level-1 MLP-ANN timeseries LF has been used to optimize the prosumer operation and scheduling. The system operation cost would be 149.1725 USD, which is much less than the operation cost using historical load data.
The comparison of the operation cost of this scenario with that of scenario 2 (as the ideal scenario) illustrated that by applying the proposed LF-based optimization method, the increase in the system operation cost due to the load data inaccuracy is limited to less than 1%. Fig. 21 shows the optimization results of the prosumer using level-1 LF data under case 2 and scenario3.

4) CASE 2-SCENARIO 4
The two-level corrective LF has been used under scenario 4. The system operation cost under this scenario would be 147.7964 USD. The comparison of the system operation costs based on the proposed two-level LF-based optimization method, ideal scenario and the available methods like [28] illustrates the advantages of the proposed method. As revealed by the test results, less than 0.1% increase in the system operation cost could be achieved by applying the proposed method (as scenario 4). Although the proposed two-level LF-based optimization method is useful under case 1 (without consideration of the BESS costs), the economic advantages of the proposed method are highlighted in case 2 (consideration of the BESS costs). In Fig. 22, the prosumer operation and scheduling under case 2-scenario 4 have been shown. Table 9 shows the operation cost of the prosumer under different cases and scenarios. As can be seen in both cases 1 and 2, the operation cost of the prosumer in scenario 4 has the least difference with scenario 2. As described above, the operation cost of scenario 2 is achieved using ideal load data. This significantly shows the effectiveness of the proposed twolevel LF method in the day-ahead operation of understudy prosumer.

V. CONCLUSION
In this paper, a novel day-ahead operation and scheduling of prosumers by using the corrective two-level LF has been proposed. The first LF level performs an MLP-ANN timeseries forecasting based on the previous historical values under the proposed method. The operation and scheduling of the prosumer are optimized by the forecasted data instead of the pre-defined values. Moreover, the real-time measurement is performed. When the inaccuracy of the forecasted load data in comparison with the measured data exceeds the desired threshold, the second level LF is triggered. The FF-ANN is used for corrective LF by using previous 30 days load patterns as inputs and actual load data on the operation day as the target.
The proposed method has been applied to a typical prosumer under various scenarios based on the load data. The comparison test results illustrated the advantages of the proposed LF-based optimal operation and scheduling of the prosumers. Moreover, the test results show that by consideration of the BESS LOL and operation cost, the advantages of the proposed method are highlighted. About 1 and 7% decrease in the prosumer operation cost could be achieved by applying the two-level LF-based optimization method under case 1 (without consideration of the BESS costs) and case 2 (by considering the BESS operation behaviors and costs), respectively.