Evaluating the Economic Beneﬁts of a Smart-Community Microgrid with Centralized Electrical Storage and Photovoltaic Systems

: In this paper, an innovative method for managing a smart-community microgrid (SCM) with a centralized electrical storage system (CESS) is proposed. The method consists of day-ahead optimal power ﬂow (DA–OPF) for day-ahead SCM managing and its subsequent evaluation, considering forecast uncertainties. The DA–OPF is based on a data forecast system that uses a deep learning (DL) long short-term memory (LSTM) network. The OPF problem is formulated as a mathematical mixed-integer nonlinear programming (MINLP) model. Following this, the developed DA–OPF strategy was evaluated under possible operations, using a Monte Carlo simulation (MCS). The MCS allowed us to obtain potential deviations of forecasted data during possible day-ahead operations and to evaluate the impact of the data forecast errors on the SCM, and that of unit limitation and the emergence of critical situations. Simulation results on a real existing rural conventional community endowed with a centralized community renewable generation (CCRG) and CESS, conﬁrmed the e ﬀ ectiveness of the proposed operation method. The economic analysis showed signiﬁcant beneﬁts and an electricity price reduction for the considered community if compared to a conventional distribution system, as well as the easy applicability of the proposed method due to the CESS and the developed operating systems.


Introduction
A microgrid is a smart power system with electrical loads, distributed generation, energy storage systems, and other components grouped in a limited geographical area. Nowadays, most existing distribution community networks can be updated to a smart-community microgrid (SCM) by adding a centralized renewable generation, an intelligent management system, and a storage unit to the community [1,2]. This allows the community to have a more resilient, efficient, and environment-friendly supplying microgrid [3]. The updated microgrid supplying infrastructure is based on the existing electrical network, which does not disturb the residents and simplifies the urban microgrid scheme [4]. The local renewable energy (RE) production supplies base-electricity to grid-connected end-user(s) and on-site assets, which are also able to run the community microgrid in the off-grid mode, for a limited period [5].

Innovative Contributions of the Proposed Method
In this research, an innovate method for managing an SCM with a CESS is proposed. The method is based on a day-ahead optimal power flow (DA-OPF) problem and its subsequent evaluation, forecast uncertainties are considered. The DA-OPF is based on the forecast of electrical load and renewable energy production. The data forecast system uses a deep learning (DL) long short-term memory (LSTM) network. The OPF problem was formulated and resolved as a mathematical MINLP model. The evaluation via MCS was performed to assess the efficiency of the day-ahead managing strategy under forecast uncertainties. The developed operation strategy could, thus, be evaluated to predict possible critical situations during the day-ahead. Based on the previous remarks, the innovate contributions of the proposed method are as follows: (1) A new method based on the combination of DA-OPF and DL based on LSTM is proposed to manage an SCM endowed with a centralized community renewable generation (CCRG) and a CESS. An MINLP model was used to solve the OPF while considering the forecasted data obtained by using DL and LSTM. (2) The economic benefits of the SCM were evaluated for a real case study in France. (3) The impact of the errors related to data forecast on the SCM operation was evaluated using an MCS.

Smart-Community Microgrid Management
The general objective of an OPF is to determine the best way to activate and to immediately operate a power system optimally, taking into account the total operating cost and constraints [53]. From another point of view, the large deployment of intermittent RE requires more flexibility from the network, and the short-term operational planning of the electrical network operation helps to bring this flexibility by optimally combine the power demand with RE generation. This challenge requires an accurate forecast of energy consumption, to reach the desired flexibility in energy management [54]. Historically, load forecasts have been the main source of uncertainty in the planning process, possibly followed by the occurrence of one-off events, such as the disconnection of equipment. In the present time, the intermittence of the RE generation also creates additional uncertainties. All these uncertainties must be taken into account within the DA-OPF. The developed operating method of an SCM is shown in Figures 1 and 2. Energies 2020, 13, x FOR PEER REVIEW 4 of 21 forecast uncertainties are considered. The DA-OPF is based on the forecast of electrical load and renewable energy production. The data forecast system uses a deep learning (DL) long short-term memory (LSTM) network. The OPF problem was formulated and resolved as a mathematical MINLP model. The evaluation via MCS was performed to assess the efficiency of the day-ahead managing strategy under forecast uncertainties. The developed operation strategy could, thus, be evaluated to predict possible critical situations during the day-ahead. Based on the previous remarks, the innovate contributions of the proposed method are as follows: (1) A new method based on the combination of DA-OPF and DL based on LSTM is proposed to manage an SCM endowed with a centralized community renewable generation (CCRG) and a CESS. An MINLP model was used to solve the OPF while considering the forecasted data obtained by using DL and LSTM. (2) The economic benefits of the SCM were evaluated for a real case study in France. (3) The impact of the errors related to data forecast on the SCM operation was evaluated using an MCS.

Smart-Community Microgrid Management
The general objective of an OPF is to determine the best way to activate and to immediately operate a power system optimally, taking into account the total operating cost and constraints [53]. From another point of view, the large deployment of intermittent RE requires more flexibility from the network, and the short-term operational planning of the electrical network operation helps to bring this flexibility by optimally combine the power demand with RE generation. This challenge requires an accurate forecast of energy consumption, to reach the desired flexibility in energy management [54]. Historically, load forecasts have been the main source of uncertainty in the planning process, possibly followed by the occurrence of one-off events, such as the disconnection of equipment. In the present time, the intermittence of the RE generation also creates additional uncertainties. All these uncertainties must be taken into account within the DA-OPF. The developed operating method of an SCM is shown in Figure 1 and Figure 2.  The flowchart of the developed smart-community microgrid (SCM) operation method-day-ahead optimal power flow (DA-OPF). The developed operation method consists of two main parts. The first, shown in Figure 1, is the DA-OPF that uses the DL data forecast to predict the input data for the OPF that is formulated as an MINLP problem. The second, is the evaluation of the DA-OPF results, by taking into account the uncertainties due to the DL data forecast ( Figure 2). The forecast uncertainties are generated using MCS. If no critical situations are observed during the evaluation, the obtained DA-OPF is applied as an operational strategy for the SCM.

Deep Learning Long Short-Term Memory Data Forecast
The general DL-LSTM network chart is shown in Figure 3. The network consists of a large number of LSTM hidden cells. Unlike conventional ANN, the LSTM network can be used to avoid exploding and vanishing gradients, as well as to model long-term dependencies on temporal data [55]. The first LSTM network cell of the LSTM zero level layer of the neural network was assigned the following initial state: as the initial cell state, ℎ as the initial output, and as the first data for The developed operation method consists of two main parts. The first, shown in Figure 1, is the DA-OPF that uses the DL data forecast to predict the input data for the OPF that is formulated as an MINLP problem. The second, is the evaluation of the DA-OPF results, by taking into account the uncertainties due to the DL data forecast ( Figure 2). The forecast uncertainties are generated using MCS. If no critical situations are observed during the evaluation, the obtained DA-OPF is applied as an operational strategy for the SCM.

Deep Learning Long Short-Term Memory Data Forecast
The general DL-LSTM network chart is shown in Figure 3. The network consists of a large number of LSTM hidden cells. Unlike conventional ANN, the LSTM network can be used to avoid exploding and vanishing gradients, as well as to model long-term dependencies on temporal data [55]. The developed operation method consists of two main parts. The first, shown in Figure 1, is the DA-OPF that uses the DL data forecast to predict the input data for the OPF that is formulated as an MINLP problem. The second, is the evaluation of the DA-OPF results, by taking into account the uncertainties due to the DL data forecast ( Figure 2). The forecast uncertainties are generated using MCS. If no critical situations are observed during the evaluation, the obtained DA-OPF is applied as an operational strategy for the SCM.

Deep Learning Long Short-Term Memory Data Forecast
The general DL-LSTM network chart is shown in Figure 3. The network consists of a large number of LSTM hidden cells. Unlike conventional ANN, the LSTM network can be used to avoid exploding and vanishing gradients, as well as to model long-term dependencies on temporal data [55]. The first LSTM network cell of the LSTM zero level layer of the neural network was assigned the following initial state: as the initial cell state, ℎ as the initial output, and as the first data for The first LSTM network cell of the LSTM zero level layer of the neural network was assigned the following initial state: C 0 0 as the initial cell state, h 0 0 as the initial output, and X 0 0 as the first data for the input data sequence time step. This first LSTM cell generates the output of the first cell h 0 1 and the updated state of the cell C 0 1 . This cell output and cell state become the input for the next hidden cell Energies 2020, 13, 1764 6 of 21 at the next time-step. In the case of multilayer applications, the cell output h 0 1 proceeds as an LSTM network upper-layer input sequence X 1 0 . The cell output h 0 1 goes to the output X f 0 , which becomes a predicted value of the nest time-step input sequence X 0 0 . In the case of the monolayer application, the cell output h 0 1 starts to already be the final forecasted data for this time-step moment. Further, this process repeats for each time-step within the studied data sequence X.
To improve the deepness of the LSTM network and to grow the LSTM forecast accuracy, the number of LSTM hidden horizontal layers can be increased (to more than one). On the other hand, each additional layer increases the forecast computing time and is not guaranteed to improve the accuracy of the final forecast.
Additional data, as temperature, weather conditions, a day of a week, etc., together with the main data sequence, help to improve the algorithm performance [56] and the forecast accuracy. These data are included in the model as an initial data matrix in the initial output X 0 0 of the LSTM network. In the centre of Figure 3, one hidden cell of the LSTM network is described. For the moment t, the LSTM cell gets the data of the input sequence X t for this time-step and the learned information from the previous periods-the cell state C t−1 and the cell output h t−1 . Applying internal hidden "gates", the cell writes, modifies, and erases parts of the earlier information to update the cell state. The main feature of the LSTM method is that the data in the network is treated by the cells hidden gates. They read, update, and write successful data and remove less relevant or irrelevant data, thus, improving the forecast efficacy and performance. There are four main gates inside the LSTM cell-the input gate I t , the update gate U t , the forget gate F t , and the output gate O t [57].
The forget gate f t is responsible for the cell state reset level. The input gate I t , for the moment t, is responsible for the level of update of cell state. The update gate U t adds information to the cell state for the moment t. The output gate O t operates the level of cell state included to the output state for the moment t. Its equations are shown in Equations (1)- (4).
In Equations (1)-(4), W, R, and b are the input weights, the recurrent weights, and the bias of the input gate for the forget gate, the input gate, the update gate, and the output gate, respectively, the tanh is the hyperbolic tangent function, X t is the time-step of sequence X at moment t, h t−1 is the previous output cell state, and σ is the sigmoid function.
The cell state c t at moment t is defined in Equation (5).
In Equation (5), stands for the Hadamard product. The output h t of the cell block at moment t is described in Equation (6).
To analyse the accuracy of the data forecast, the mean absolute percentage error (MAPE) and the mean average error (MAE) presented in Equations (7) and (8), respectively, are used.
In Equation (7) and Equation (8), X i and X * i are the real and the predicted data value, N is the testing samples number.
MAPE demonstrates the error of the applied methods compared with real data in percentage; MAE presents the average numerical difference between the forecasted and real data.

Day-Ahead Optimal Power Flow Formulation
The OPF problem for each dataset is solved by using the MINLP optimisation. MINLP aims to optimize a complex, large-scale, highly non-linear problem with nonlinear constraints, the SCM operation being a prime example [8]. MINLP problems involve both continuous and discrete variables that arise in many applications of engineering design, chemical engineering, and process operations research and management. These applications are extensively surveyed in [58][59][60]. Although many optimization approaches have been developed for the MINLP problems, these methods still have drawbacks including only finding local or approximate solutions or using too many extra binary variables and constraints to reformulate the problem. The resolution is an approach to find the global optima of MINLP by solving the mixed local optima of the objective function and the auxiliary functions, alternately [61]. The MINLP approach considers not only the nonlinear dependence between power generation, PV production, consumption, electricity price, etc., but also takes into consideration many other constraints, such as the start-up costs for the generation units, storage operation costs, and the discontinuous operating regions, leading to more realistic and feasible results [62]. The developed mathematic formulation of the OPF problem for SCM is presented below.

The Objective Function for SCM OPF
The considered objective function aims at minimizing the SCM operation cost, as shown in Equation (9).
It is composed of two terms-the first is related to the cost of grid power utilization, as shown in Equation (10).
In Equation (10), t is the period, i is the index of the unit (supply power lines, fixed or flexible loads), g ti + is the amount of power injected into the grid at time t, for unit i, g ti − is the amount of power absorbed from the grid at time t, for unit i, C ti g+ (·), C ti g− (·) are the cost function for the active power injected or absorbed to/from the grid at time t, for unit i.
SCM loads (fixed and flexible) are modeled as the negative grid power utilization from Equation (2) [63]. The flexible load is the type of SCM load that can be curtailed by paying a fee. The fixed load should not be curtailed and in the curtail case, the fee to be paid is much higher than for the flexible load case. The cost of SCM RE generation is considered to be zero and not taken into consideration in the objective function.
The second term represents the stored energy cost. It is the expected stored energy cost at the beginning and at the end of the considered period. It is presented in Equation (11).
In Equation (11), where Se 0 is the initial stored energy in the storage unit i, p c , p d are the charged/discharged power of the storage unit i in time t, C s0 vector of the prices linked to reaching the stored energy S 0 in the storage unit i at time t = 0, C s0 t vector of the prices linked to reaching the stored energy S 0 in the storage unit i in the terminal end-of-horizon base state, C c , C d are the vectors of prices for terminal storage charging/discharging contributions of the storage unit i in the terminal end-of-horizon base states.

DA-OPF Constraints
To obtain the correct optimization, the MINLP needs to respect numerous constraints of the OPF optimization. The most common constraints are shown below.
The general OPF equality constraints are shown in Equation (12). The OPF constraints of inequality as the power flow and voltage limits are shown in Equation (13) [64].
In Equation (13), q t , V t , p t are voltage angles, magnitudes, and active power injections at time t. Unit constraints are described in Equation (14).
In Equation (14), o ti is a binary commitment state for the unit i in period t (1 if the unit is on-line, 0 if off-line), P ti min , P ti max are the limits of active injection for unit i at time t. The storage operation limits are in Equations (15)-(17).
The storage level limits are shown in Equation (18) and Equation (19).
In Equations (18) and (19), Se − ti , Se + ti are the stored energy upper/lower limits in the storage unit i at the end of the period t (calculated endogenously), t = 0 represents the limits at the beginning of the period. Storage dispatch considering the energy bounds described in Equations (20) and (21).
In Equations (20) and (21), Se − (t−1)i , Se + (t−1)i are the stored energy upper/lower limits in the storage unit i at the end of period t − 1 (calculated endogenously), Se −ti0 is the expected stored energy in storage unit i, at the beginning of period t, Se D ti are the net growths in stored energy because of charging or discharging for unit i at time t, p ti is a parameter that determines the weighting in storage limitation. Here the storage dispatch limits are computed relative to a weighted average of previous period endogenous bounds Se − (t−1)i , Se + (t−1)i (p ti = 1), and the initial expected stored energy (p ti = 0) for storage unit i at period t.
In those cases when it is expected that the stored energy at the end of the observed period needs to be equal to the initial stored energy (cyclic operation of the storage system case), the constraints are described in Equations (22) and (23).
Energies 2020, 13, 1764 It becomes another constraint for MINLP OPF optimisation. The frame of reference for the developed OPF is to minimise the locational average marginal price (LAMP). LAMP is the average value of the locational marginal pricing (LMP) for a given period. LMP is a way to show the value of electric energy at different locations, accounting for the patterns of load, generation, and the physical limits of the transmission system [65][66][67]. LMP reflects a higher hardness to supply an additional unit of power at a specified node. This can be derived from transferring power of other generators, to supply large loads or, perhaps, be caused by congestion and losses.
The LMP consists of the main following three components [68]: 1.
The energy component is the price for electric energy at the "reference point", which is the load-weighted average of the system node prices.

2.
The congestion component reflects the marginal cost of congestion at a given node or external node, relative to the load-weighted average of the system node prices. The congestion component of a zonal price is the weighted average of the congestion components of the nodal prices that comprise the zonal price.

3.
The power loss component at a given node or external node reflects the cost of power loss at that location, relative to the load-weighted average of the system node prices. The power loss component of a zonal price is the weighted average of the power loss components of the nodal prices that comprise the zonal price.
The Monte Carlo simulation (MCS) method is used to estimate the objective function value [69]. Using the component data distribution, an MCS generates its data observations. The optimization model solves N times an MCS, to obtain N observations of the required component data [70]. This solving process stops when the number of iterations reaches the limit (or stopping criterion) [68], or the optimal solution has been found [69].
As shown in Figure 2, for actual research, the MCS would be performed 31 times in series, and this series would be replicated N times, to evaluate the possible impact on SCM management, due to the data forecast error. The choice of N should assure a compromise between simulation accuracy and computing time [69]. According to [71], the stopping simulation criterion is presented in Equation (24).
In Equation (24), E(X) and σ(X) are the mean value of LAMP for simulated day and its standard deviation, N is the number of simulation samplings, and ε is the chosen maximum allowed simulation error. The use of MCS for DA-OPF allows the evaluation of the impact of errors related to data forecast on the SCM operation.
The practical validation of developed and evaluated DA-OPF would be produced with the real data community simulation described below.

Studied Smart-Community Microgrid
The data for the studied SCM is based on a real conventional rural grid and particularly on the existing conventional electric distribution system of a rural community in Chamberet, France. The rural community is situated in the central massive of Metropolitan France, with an average population of 1300 habitants, 200-250 households, with a maximum power consumption of 1800 kW. Figure 4 shows the main scheme of the SCM created on it. The black lines represent the existing infrastructure of the radial distribution system of the community. It consists of the main power line linked to the distribution network with the BUS 1, a middle voltage power line connects BUS1 and BUS 3, and the considered community is connected to BUS 3.  The estimated further growth of electricity demand within the community puts a reliable electrical energy supply for the community at risk. The already overcharged middle voltage power line from BUS1 to BUS3 requires not only the construction of an additional power line from BUS1 to BUS3 but also the reconstruction of the existing main power line connected to the main distribution grid (DG) (for possible further growth of the system). To resolve these problems and to allow further development of the studied community with economical and ecological resilient power supply, it was decided to convert the existed community power infrastructure into SCM.
To create an SCM from the already existing conventional electrical network, centralized storage and renewable generation equipment were installed. A PV plant with a peak power production of 1500 kW has been installed at BUS2. This bus is connected with the BUS1 and BUS3 with 2 power lines of 1000 kVA of maximum power capacity. This allows transferring all power produced by the PV plant to the community or the main grid.
Lines connecting BUS1-BUS3, BUS2-BUS3, BUS3-BUS2 are considered to be equal small distances, (less than several kilometres) with the same impedance. The losses in the powerlines are neglected. The grid can, thus, be represented as a triangle distribution network with 3 different power supplies (Grid, PV, and Community Storage). A summary of the studied community data is given in Table 1. Table 1. Data of the studied community.

Topology
3-bus triangle network Power supply line 2000 kVA limit, power line at bus 1

Storage
Capacity: 5000 kWh unit at bus 3 Max Charging/Discharging Rate: 3000 kW/hour Charged/discharged electricity price is 35 c€/kWh During the period of high electricity demand in the DG (16-21 h), the possibility of the flexible load reduction of the total amount of 1000 kWh is considered. This could be attributed to demand response or load shifting program application. This flexible load is a community consumption that The estimated further growth of electricity demand within the community puts a reliable electrical energy supply for the community at risk. The already overcharged middle voltage power line from BUS1 to BUS3 requires not only the construction of an additional power line from BUS1 to BUS3 but also the reconstruction of the existing main power line connected to the main distribution grid (DG) (for possible further growth of the system). To resolve these problems and to allow further development of the studied community with economical and ecological resilient power supply, it was decided to convert the existed community power infrastructure into SCM.
To create an SCM from the already existing conventional electrical network, centralized storage and renewable generation equipment were installed. A PV plant with a peak power production of 1500 kW has been installed at BUS2. This bus is connected with the BUS1 and BUS3 with 2 power lines of 1000 kVA of maximum power capacity. This allows transferring all power produced by the PV plant to the community or the main grid.
Lines connecting BUS1-BUS3, BUS2-BUS3, BUS3-BUS2 are considered to be equal small distances, (less than several kilometres) with the same impedance. The losses in the powerlines are neglected. The grid can, thus, be represented as a triangle distribution network with 3 different power supplies (Grid, PV, and Community Storage). A summary of the studied community data is given in Table 1. Table 1. Data of the studied community.

3-bus triangle network
Power supply line 2000 kVA limit, power line at bus 1

Load (Consumption)
1800 kW total load at bus 3 the fixed load is curtailable at €1/kWh the flexible load is curtailable at 35c€/kWh response or load shifting program application. This flexible load is a community consumption that can be cut without big inconvenience for the SCM and its end-users, but the remuneration for this action would be according to the flexible load curtailable price.

DA-OPF Forecasted and Real SCM Data
The DL LSTM network generates the forecasts of PV generation and electrical energy consumption according to historical data (including weather conditions and temperature).
To test the developed DA-OPF and evaluate the data forecast accuracy, two real data SCM characteristic days of the year are chosen. For the first case, a sunny day from the winter season, as shown in Figure 5, for the second case, a cloudy day in the summer season, as shown in Figure 6. In Figures 5 and 6, the forecasted values of the PV generation and consumption are shown together with the real data. Data forecast is obtained based on one-year historical real data, including the weather forecast, and after training the DL-LSTM network. The similarity of the obtained forecasted data with the real data showed good accuracy of the chosen LSTM network. can be cut without big inconvenience for the SCM and its end-users, but the remuneration for this action would be according to the flexible load curtailable price.

DA-OPF Forecasted and Real SCM Data
The DL LSTM network generates the forecasts of PV generation and electrical energy consumption according to historical data (including weather conditions and temperature).
To test the developed DA-OPF and evaluate the data forecast accuracy, two real data SCM characteristic days of the year are chosen. For the first case, a sunny day from the winter season, as shown in Figure 5, for the second case, a cloudy day in the summer season, as shown in Figure 6. In Figures 5 and 6, the forecasted values of the PV generation and consumption are shown together with the real data. Data forecast is obtained based on one-year historical real data, including the weather forecast, and after training the DL-LSTM network. The similarity of the obtained forecasted data with the real data showed good accuracy of the chosen LSTM network.  The analyses of error between the forecasted and real data are presented in Table 2, using MAPE and MAE.   can be cut without big inconvenience for the SCM and its end-users, but the remuneration for this action would be according to the flexible load curtailable price.

DA-OPF Forecasted and Real SCM Data
The DL LSTM network generates the forecasts of PV generation and electrical energy consumption according to historical data (including weather conditions and temperature).
To test the developed DA-OPF and evaluate the data forecast accuracy, two real data SCM characteristic days of the year are chosen. For the first case, a sunny day from the winter season, as shown in Figure 5, for the second case, a cloudy day in the summer season, as shown in Figure 6. In Figures 5 and 6, the forecasted values of the PV generation and consumption are shown together with the real data. Data forecast is obtained based on one-year historical real data, including the weather forecast, and after training the DL-LSTM network. The similarity of the obtained forecasted data with the real data showed good accuracy of the chosen LSTM network.  The analyses of error between the forecasted and real data are presented in Table 2, using MAPE and MAE.  The analyses of error between the forecasted and real data are presented in Table 2, using MAPE and MAE.  Table 3 shows that the accuracy of the data forecast was around 5-10 % percent and that this was acceptable, relative to the size of the studied SCM. This forecast error would be taken into consideration during the MCS evaluation. Figure 7 shows the curves of the considered dynamic electricity price obtained by the main power line from DG, for both studied seasons, as well as the curtailable price of the flexible SCM load.
Energies 2020, 13, x FOR PEER REVIEW 12 of 21 Table 3 shows that the accuracy of the data forecast was around 5-10 % percent and that this was acceptable, relative to the size of the studied SCM. This forecast error would be taken into consideration during the MCS evaluation. Figure 7 shows the curves of the considered dynamic electricity price obtained by the main power line from DG, for both studied seasons, as well as the curtailable price of the flexible SCM load. When the curtailable flexible load price was under DG electricity price, it was highly probable that OPF would choose to curtail the flexible load during this time, as it was cheaper to pay the curtailable fee than to supply this flexible load. Figure 8 shows the 24-h operation of the considered tested SCM, under the developed DA-OPF. This figure shows the forecasted and real SCM PV and consumption data, the DA-OPF and real grid operation, the CESS operation. It can be seen that, during the first part of the day, when the grid electricity price was low and the CCRG supply had not yet started, the OPF optimisation charged the CESS for further supply of community consumption during the high price zone (the forecast showed insufficient CCRG in the course of the considered day). During peak hours, the OPF maximized the storage utilization for community supply (considering power-line congestion).  When the curtailable flexible load price was under DG electricity price, it was highly probable that OPF would choose to curtail the flexible load during this time, as it was cheaper to pay the curtailable fee than to supply this flexible load. Figure 8 shows the 24-h operation of the considered tested SCM, under the developed DA-OPF. This figure shows the forecasted and real SCM PV and consumption data, the DA-OPF and real grid operation, the CESS operation. It can be seen that, during the first part of the day, when the grid electricity price was low and the CCRG supply had not yet started, the OPF optimisation charged the CESS for further supply of community consumption during the high price zone (the forecast showed insufficient CCRG in the course of the considered day). During peak hours, the OPF maximized the storage utilization for community supply (considering power-line congestion).

The DA-OPF: Winter Case
Energies 2020, 13, x FOR PEER REVIEW 12 of 21 Table 3 shows that the accuracy of the data forecast was around 5-10 % percent and that this was acceptable, relative to the size of the studied SCM. This forecast error would be taken into consideration during the MCS evaluation. Figure 7 shows the curves of the considered dynamic electricity price obtained by the main power line from DG, for both studied seasons, as well as the curtailable price of the flexible SCM load. When the curtailable flexible load price was under DG electricity price, it was highly probable that OPF would choose to curtail the flexible load during this time, as it was cheaper to pay the curtailable fee than to supply this flexible load. Figure 8 shows the 24-h operation of the considered tested SCM, under the developed DA-OPF. This figure shows the forecasted and real SCM PV and consumption data, the DA-OPF and real grid operation, the CESS operation. It can be seen that, during the first part of the day, when the grid electricity price was low and the CCRG supply had not yet started, the OPF optimisation charged the CESS for further supply of community consumption during the high price zone (the forecast showed insufficient CCRG in the course of the considered day). During peak hours, the OPF maximized the storage utilization for community supply (considering power-line congestion).  In the considered winter day, according to the developed DA-OPF, some flexible load in high-price zones was curtailed instead of supplying them with high-price electricity from the distribution system.  Figure 9 shows the grid electricity price, the curtailable price of flexible load, the forecasted and real LAMP for the winter day case and also the LAMP position regarding the DG electricity price.

The DA-OPF: Winter Case
Energies 2020, 13, x FOR PEER REVIEW 13 of 21 In the considered winter day, according to the developed DA-OPF, some flexible load in highprice zones was curtailed instead of supplying them with high-price electricity from the distribution system. Figure 9 shows the grid electricity price, the curtailable price of flexible load, the forecasted and real LAMP for the winter day case and also the LAMP position regarding the DG electricity price. Before conversion to SCM, the studied rural community had a slack distribution system, which in the case of high demand for electricity was not able to supply all necessary electricity to the rural community. In this case, when the load demand was higher than the existing branch line (BUS1-BUS3) transfer capacity of Figure 4, the LAMP was higher than the DG electricity price, which was directly related to the slack distribution system and the curtailable penalties.
After conversion to SCM, the system obtained two additional branch lines. In this case, when the slack bus was reinforced by the two additional branch lines, the LAMP should not have been higher than the DG electricity price (due to the absence of line contingencies). Whereas the distance between BUS1, BUS2, and BUS3 was considered to be small, and the consumption was only located at BUS3; the LAMP is shown for BUS3 (for the SCM case). Likewise, losses in the branches could be neglected. Furthermore, due to the implementation of systems of CESS and CCRG, the LAMP of the studied SCM in some cases was lower than the DG electricity price [72].
The operation values of winter day simulation are shown in Table 3. Table 3. One-day OPF simulation (winter day). The storage system was operated considering a constraint, for which at the beginning and the end of the day, the State of Charge (SOC) was the same for both cases (SOC 0.5 in the beginning and the end of the day). This allowed the SCM to have a security level of energy storage to resiliently supply the community in the case of main distribution line faults or other accidents. Table 4 shows the economic evaluation and more precisely the amounts of grid electricity and electricity cost, which was used for the developed SCM supply scheme and DA-OPF, compared to a conventional one. The conventional scheme considers the black lines of Figure 4, i.e., the existing infrastructure part. Before conversion to SCM, all consumed community electricity was bought with the corresponding price from the DG, from the main power line, through branches 1-3. For the winter case, with a conventional scheme, around 25,514 kWh would be bought from the DG, and in those cases when the load demand was higher than the branch line 1-3 (BUS 1-BUS3) limits, the load would Before conversion to SCM, the studied rural community had a slack distribution system, which in the case of high demand for electricity was not able to supply all necessary electricity to the rural community. In this case, when the load demand was higher than the existing branch line (BUS1-BUS3) transfer capacity of Figure 4, the LAMP was higher than the DG electricity price, which was directly related to the slack distribution system and the curtailable penalties.

Operation values DA-OPF (kW) Real Value (kW) Error (%) Error (kW)
After conversion to SCM, the system obtained two additional branch lines. In this case, when the slack bus was reinforced by the two additional branch lines, the LAMP should not have been higher than the DG electricity price (due to the absence of line contingencies). Whereas the distance between BUS1, BUS2, and BUS3 was considered to be small, and the consumption was only located at BUS3; the LAMP is shown for BUS3 (for the SCM case). Likewise, losses in the branches could be neglected. Furthermore, due to the implementation of systems of CESS and CCRG, the LAMP of the studied SCM in some cases was lower than the DG electricity price [72].
The operation values of winter day simulation are shown in Table 3. The storage system was operated considering a constraint, for which at the beginning and the end of the day, the State of Charge (SOC) was the same for both cases (SOC 0.5 in the beginning and the end of the day). This allowed the SCM to have a security level of energy storage to resiliently supply the community in the case of main distribution line faults or other accidents. Table 4 shows the economic evaluation and more precisely the amounts of grid electricity and electricity cost, which was used for the developed SCM supply scheme and DA-OPF, compared to a conventional one. The conventional scheme considers the black lines of Figure 4, i.e., the existing infrastructure part. Before conversion to SCM, all consumed community electricity was bought with the corresponding price from the DG, from the main power line, through branches 1-3. For the winter case, with a conventional scheme, around 25,514 kWh would be bought from the DG, and in those cases when the load demand was higher than the branch line 1-3 (BUS 1-BUS3) limits, the load would be cut (about 762 kWh for actual case). For the conventional scheme, it was assumed that all load was curtailable at €1/kWh.  Table 4 also shows the benefits and economic savings for the SCM and the community end-user. The actual economic analysis considers only the net bill for the studied day, without taking into account the community microgrid equipment price (PV and ESS Systems), the wear and tear and operation price of the equipment, and additional prices. The total SCM electricity price consists only of the purchase price for electricity consumed from the DG. The social wellbeing of the final SCM end-user is represented in a way such that during power supply, according to the developed DA-OPF, the fixed load supply was not cut and the SCM, and therefore, the final end-user, obtained the most economic power supply as a result of being a part of the SCM.
Due to the developed operation method, the SCM would save 3405 € per day, without degradation of the SCM power supply. This represents around 42% of bill reduction and allows for the considered community to have a resilient, ecological, and economic power supply.

The DA-OPF: Summer Case
During the summer period, the DG electricity price would be lower as the renewable energy generation and the flexible load curtailable price was considered to be the same for both cases (at 35 c€/kWh). Consequently, the flexible load was not cut since the electricity price was lower than the flexible load curtailable price. This allowed the SCM to increase the economic benefits, as it did not need to pay the curtailable fee for the end-user. Figures 10 and 11 show the 24-h operation of the SCM for the considered summer day case. As can be seen, in this case, the community PV generation was not very high due to the cloudy weather. As well as in the previous case, the developed DA-OPF maximised the use of the storage system during the high-grid electricity price zone. be cut (about 762 kWh for actual case). For the conventional scheme, it was assumed that all load was curtailable at €1/kWh.  Table 4 also shows the benefits and economic savings for the SCM and the community end-user. The actual economic analysis considers only the net bill for the studied day, without taking into account the community microgrid equipment price (PV and ESS Systems), the wear and tear and operation price of the equipment, and additional prices. The total SCM electricity price consists only of the purchase price for electricity consumed from the DG. The social wellbeing of the final SCM end-user is represented in a way such that during power supply, according to the developed DA-OPF, the fixed load supply was not cut and the SCM, and therefore, the final end-user, obtained the most economic power supply as a result of being a part of the SCM.
Due to the developed operation method, the SCM would save 3405 € per day, without degradation of the SCM power supply. This represents around 42% of bill reduction and allows for the considered community to have a resilient, ecological, and economic power supply.

The DA-OPF: Summer Case
During the summer period, the DG electricity price would be lower as the renewable energy generation and the flexible load curtailable price was considered to be the same for both cases (at 35 c€/kWh). Consequently, the flexible load was not cut since the electricity price was lower than the flexible load curtailable price. This allowed the SCM to increase the economic benefits, as it did not need to pay the curtailable fee for the end-user. Figures 10 and 11 show the 24-h operation of the SCM for the considered summer day case. As can be seen, in this case, the community PV generation was not very high due to the cloudy weather. As well as in the previous case, the developed DA-OPF maximised the use of the storage system during the high-grid electricity price zone.   As can be seen, the LAMP of SCM was lower than the grid electricity price in both cases, which showed that the SCM obtained benefits for all operating conditions. This decrease was related to the deployment of CESS and CCRG.
The operation values of the summer day simulation are shown in Table 5. The amount of charged and discharged electricity during the considered day indicate the correct operation of the developed OPF optimisation, as well as its accuracy.  Table 6 shows the economic evaluation and more precisely the amounts of grid electricity and electricity cost that was used for the developed SCM supply scheme and DA-OPF, compared to a conventional one. The economic savings for the studied SCM summer day consists of 1314€ or 34% of the community grid electricity bill, compared to the conventional scheme without degradation of the SCM power supply.

DA-OPF Evaluation
This section presents the practical application of the developed DA-OPF evaluation of the studied SCM, under forecast uncertainties. The evaluation was realised on the forecasted data of the winter season case. The general chart is shown in Figure 2 (DA-OPF evaluation module). For this case, the input data of OPF in the evaluation module were the DG electricity price, the forecast PV generation, and the forecast of SCM consumption. Data sets were generated by MCS and by taking possible deviations of the forecasted data due to the forecast error into consideration. The output data of OPF in the evaluation module consist of sets of the CESS SCM operation, the DG operation, and the LAMP data. As can be seen, the LAMP of SCM was lower than the grid electricity price in both cases, which showed that the SCM obtained benefits for all operating conditions. This decrease was related to the deployment of CESS and CCRG.
The operation values of the summer day simulation are shown in Table 5. The amount of charged and discharged electricity during the considered day indicate the correct operation of the developed OPF optimisation, as well as its accuracy.  Table 6 shows the economic evaluation and more precisely the amounts of grid electricity and electricity cost that was used for the developed SCM supply scheme and DA-OPF, compared to a conventional one. The economic savings for the studied SCM summer day consists of 1314€ or 34% of the community grid electricity bill, compared to the conventional scheme without degradation of the SCM power supply.

DA-OPF Evaluation
This section presents the practical application of the developed DA-OPF evaluation of the studied SCM, under forecast uncertainties. The evaluation was realised on the forecasted data of the winter season case. The general chart is shown in Figure 2 (DA-OPF evaluation module). For this case, the input data of OPF in the evaluation module were the DG electricity price, the forecast PV generation, and the forecast of SCM consumption. Data sets were generated by MCS and by taking possible deviations of the forecasted data due to the forecast error into consideration. The output data of OPF in the evaluation module consist of sets of the CESS SCM operation, the DG operation, and the LAMP data. DA-OPF evaluation aims to revise the impact of forecast data errors on the SCM operation and particularly the compliance with the SCM unit limits, the possibility of the emergence of critical and dangerous situations, and the assurance of the system stability during possible SCM operation. Figure 12 shows the OPF evaluation of the obtained DA-OPF, under forecast uncertainties for the winter study case, described in Section 3.1.
Energies 2020, 13, x FOR PEER REVIEW 16 of 21 DA-OPF evaluation aims to revise the impact of forecast data errors on the SCM operation and particularly the compliance with the SCM unit limits, the possibility of the emergence of critical and dangerous situations, and the assurance of the system stability during possible SCM operation. Figure 12 shows the OPF evaluation of the obtained DA-OPF, under forecast uncertainties for the winter study case, described in Section 3.1.    Figure 13 shows the possible evaluations of different DA-OPF parameters related to the forecast errors and their impact on the day-ahead SCM operation. The evaluation process controls the respect of unit lines and power limits, ramping UP and DOWN unit limitation, the min and max SOC of CESS levels, and others. The evaluation helped to detect the possibility of the appearance of critical situations during the day-ahead operation of SCM, according to the DA-OPF strategy, to indicate it, and to take action to preserve the resilient and economical operation of the SCM.
Once the DA-OPF evaluation found no possible problems or collapse situations of the developed DA-OPF, the developed DA-OPF could be confirmed as the day-ahead SCM operation strategy.  DA-OPF evaluation aims to revise the impact of forecast data errors on the SCM operation and particularly the compliance with the SCM unit limits, the possibility of the emergence of critical and dangerous situations, and the assurance of the system stability during possible SCM operation. Figure 12 shows the OPF evaluation of the obtained DA-OPF, under forecast uncertainties for the winter study case, described in Section 3.1.    Figure 13 shows the possible evaluations of different DA-OPF parameters related to the forecast errors and their impact on the day-ahead SCM operation. The evaluation process controls the respect of unit lines and power limits, ramping UP and DOWN unit limitation, the min and max SOC of CESS levels, and others. The evaluation helped to detect the possibility of the appearance of critical situations during the day-ahead operation of SCM, according to the DA-OPF strategy, to indicate it, and to take action to preserve the resilient and economical operation of the SCM.
Once the DA-OPF evaluation found no possible problems or collapse situations of the developed DA-OPF, the developed DA-OPF could be confirmed as the day-ahead SCM operation strategy.  Figure 13 shows the possible evaluations of different DA-OPF parameters related to the forecast errors and their impact on the day-ahead SCM operation. The evaluation process controls the respect of unit lines and power limits, ramping UP and DOWN unit limitation, the min and max SOC of CESS levels, and others. The evaluation helped to detect the possibility of the appearance of critical situations during the day-ahead operation of SCM, according to the DA-OPF strategy, to indicate it, and to take action to preserve the resilient and economical operation of the SCM.
Once the DA-OPF evaluation found no possible problems or collapse situations of the developed DA-OPF, the developed DA-OPF could be confirmed as the day-ahead SCM operation strategy.

Discussion
Due to progress in computing power, computer vision and artificial intelligence, the DL approaches start to be more feasible and more accessible to be applied. The bibliographic analysis in this research presents DL LSTM as one of the most performant, accurate, promising approaches, which is well-adapted for the SCM technology of data forecasting. As well, previous researches also recognise that the microgrid has a lot of non-linear components. Nevertheless, due to the complexity of formulation, researches use simplified relaxed mathematical linear formulation, such as MILP, fuzzy logic, or another linear optimisation technique. Solutions become easier to be obtained but not necessarily in the optimal way. The progress in computing power and new mathematical optimisation solvers allow resolving the more complicated type of problems faster than before, for example, by taking advantage of MINLP for SCM. Other research efforts separately study the error of data forecast and its influence on the day-ahead microgrid operation. This allows for the developed operation strategy to be evaluated and critical situations to be predicted during the day-ahead. Notwithstanding, none of the reviewed articles included all these technologies together. In light of this, the proposed work attempts to apply all these promising methods together-a more effective data forecast technology, a performant optimisation technique and uncertainty evaluation, to obtain a more efficient and economic result for SCM operation.
The analysis of operational data of a practical case already demonstrated a completely different level of results if compared to the classical self-consumption operation strategies. MINLP allowed finding the global operation optimum for each timestep and the DA-OPF operation strategy of the estimated day demonstrated better results if compared with conventional operation techniques. The obtained results showed that these technologies could eventually significantly reduce the SCM day electricity price, without degrading the SCM energy supply.
For future research directions, it would be possible to attempt to evaluate more precise methods for data forecasting with more complicated cases, decentralised sources of energy storage, and RE generation located in different geographical places with different weather (an SCM of a bigger scale), also exploring other DA-OPF evaluation techniques.

Conclusions
In this research, an innovative method for management of an SCM is developed and presented. This method consists of two parts. At first, a DA-OPF based on the DL data forecast to predict the input data for the OPF is formulated as an MINLP problem. Then the evaluation of the DA-OPF results by taking into account the uncertainties of DL data forecast is carried out. Simulation results are based on the real existing rural conventional community converted to SCM through the integration of CCRG and CESS. For this, the SCM is evaluated via two characteristic cases of operation-a winter sunny day and a summer cloudy day. The subsequent economic analysis showed significant benefits and an electricity price reduction for the considered SCM of about 30%-40% if compared to a conventional scheme (before the conversion of a conventional rural community to an SCM). The proposed method is promising in real applications and shows easy applicability due to the use of a CESS and the developed operating systems. The developed DA-OPF operation method also assures a resilient, intelligent, and high economic power supply for the SCM.