Predictive Optimization Based Energy Cost Minimization and Energy Sharing Mechanism for Peer-to-Peer Nanogrid Network

The scientific community believes that peer-to-peer energy trading will dominate a significant portion of forthcoming power generation systems research. Despite a plethora of optimal energy trading solutions, optimizing the trading cost and intelligent formation of energy sharing strategies are deemed exigent problems. Contemplating the excessive rise of energy demands across the globe, this study introduces a predictive optimization-based nanogrid energy trading model that minimizes energy trading cost and provides an optimal energy sharing plan between peers connected within a nanogrid network/cluster. The proposed study comprises two folds: (1) PSO-enabled objective function incorporating actual and predicted values of essential energy attributes, is implemented to reduce the trading cost, (2) an intelligent time-aware energy sharing strategy to determine the role of peers, and foster the harness of renewable energy to meet the energy requirements. The study also comprehensively analyzes essential nano-grid energy parameters and predicts energy load, consumption, and cost to grasp the time-interval-based energy trends. In addition, an optimal ESS charging and discharging operation is devised to manage excess power efficiently. The proposed model is validated on the case study containing data of 12 nanogrid houses. The outcomes yield that the proposed study holds significant potential in reducing the trading cost and optimally sharing the energy within the P2P network.


I. INTRODUCTION
Since the last decade, non-renewable energy resources such as coal, oil, and natural gas have been deemed primary sources for satiating the global energy demand [1]- [3]. However, their adverse socio-economic and environmental impacts, such as the high cost of power generation, failure to fulfill energy requirements of the burgeoning population, and degradation of the environment, restrict the energy user's dependence over them [4], [5]. On the other hand, Renewable Energy Resources (hereinafter ''RES'') like solar, wind, tidal, nuclear, hydro, biomass hold a promising potential to generate eco-friendly energy. Therefore, RES based energy resources are in tandem with generally and has also been favored by eco-friendly organizations. Moreover, renewable energy resources generate energy with lower production The associate editor coordinating the review of this manuscript and approving it for publication was Amedeo Andreotti .
prices and transmission cost [6], [7]. In the contemporary era, the sheer dependence of power grids over non-renewable sources is a recipe for environmental disaster and failure to bridge mushrooming energy demand-supply gap; therefore, power grids require lion's share of energy supply from RES. RES has revolutionized the energy sectors of the present era with the increasing deployment of distributed generators and Energy Storage Systems (ESS) [8]. The adverse impacts of RES in the demand side are mitigated with the initiation of microgrid and nanogrid (NG). A nanogrid is a simpler form of a microgrid that involves a single load encompassing a single house [9]. In other words, NG is deemed a single entity for administration, voltage, and reliability, and at least one gateway at the outside of NG. The main feature of NG is its potential to get connected with other NG, forming a nanogrid cluster [9]. This ease of interconnectivity has introduced the concept of P2P energy trading, which fosters the use of renewable energy resources, evading the reliance on the VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ utility grid resulting in reduced nanogrid cost. P2P energy trading implements the same notion as P2P networking in Computer Science wherein the systems in P2P networks are horizontally disseminated, indicating that each of them has symmetric interaction an [10], [11]. The radical evolution of RES enables peer-to-peer (P2P) energy trading between homes or buildings [12]. P2P energy trading follows the notion of ''P2P economy'', and is executed within the local energy distribution network [13]. The energy trading process involves two or more peers, often referred to as consumers and prosumers. Energy consumers are the peers who can generate energy to fulfill their energy requirements. In contrast, the intelligent smart grid infrastructures allow the peers to generate surplus energy and inject it into the distribution systems, thus assuming prosumers' role to produce and trade surplus energy with other peers in the network. The core objective of P2P energy trading is to mitigate the intermediation of conventional energy suppliers (i.e., power grid) and fulfill energy demands in a cost-efficient manner [14], [15]. The energy trading operation employs Information and Communication Technologies (ICT)-based online services to enable interaction among peers [16]. The peers involved in the trading operation, i.e., consumer and prosumer, both have an instrumental role in the trading process. The efficient energy trading operation requires optimal planning to fulfill real-time energy demand at a minimal energy cost. The scientific community has presented various P2P energy trading models to enhance the trading mechanisms facilitating both consumers and prosumers in terms of improved energy demand and response signal and reduced energy cost [17], [18]. Optimization plays a pivotal role in providing sustainable smart solutions [19]- [25]. Energy optimization selects the best/optimal option from multiple solutions for efficient energy operation. The model [26] optimizes the energy trading among two microgrids harnessing a central controller to operate in an islanded mode. Moradzadeh and Tomsovic (2013) [27] implemented a two-stage pricing mechanism to provide economical energy cost. The study [28] allows multiple prosumers to involve in energy trading by proposing a cooperative distributed power generation. The outcomes were evaluated by assessing electricity consumption and cost. The wind power producers were facilitated with the bidding-based P2P energy trading method presented by [29]. Umer et al. [30] implemented a communication-oriented P2P energy trading model to provide economical energy trading solutions to prosumers. Paudel et al. (2020) [31] suggested a decentralized market clearing strategy model. Esmat et al. [32] implemented the same idea as [31] to provide secure energy trading using blockchain. The recent trend in the energy trading sector involves the paradigm of machine learning to reveal the hidden patterns from the energy corpus to form a predictive model and use the derived knowledge for efficient decisionmaking [33], [34]. Day-ahead information forecasting in the energy trading sector has been proven helpful for energy providers to schedule the power loads or predict energy cost to ensure the balance between energy demand and production at an optimal cost [35]. The strategies devised from energy forecasting parameters reduce production costs and better future capacity planning [13]. In [36], authors have employed a machine learning-based forecasting model to predict energy demands to optimize the overall energy operation of the microgrid. Similarly, in [37], the authors presented a hybrid energy management system incorporating fuzzy logic and machine learning to solve the multi-objective optimization problem using linear programming. The experiments carried out by [38] validated that day-ahead pricing can significantly reduce peak loads and energy costs. The day-ahead pricing information was incorporated to schedule the appliances as per user comfort while ensuring the minimal cost. Similarly, the PV energy trading model was suggested using forecasted PV power information for load scheduling [39]. Anoh et al. [40] formed a virtual microgrid connecting the consumers and prosumers located at a minimum distance and provided minimal energy purchasing cost of PV power. Energy trading cost optimization algorithm was implemented to enable energy sharing at a minimal cost Alam et al. (2019) [41]. Most of the contemporary nanogrid energy trading systems focus on managing energy inside a single entity i.e., consumers or prosumers. Prousmer-oriented enegry trading framework has been suggested in [42]. Paudel et al. (2018) [43] developed game-theoretic model for a microgrid infrastructure to provide optimal energy cost plan for prosumers. The scientific community has successfully provided cost-efficient and eco-friendly energy solutions. However, various essential aspects are needed to be incorporated to improve the performance of energy trading frameworks, ensuring maximum profits to both consumers and prosumers. Moreover, smart grid energy trading can significantly benefit from the history learnings of load's pattern data, reducing the trading cost to a great extent. We believe that intelligent integration of predictive energy parameters with optimal energy cost and energy sharing planning can significantly reduce the nanogrid energy trading cost. This study presents an intelligent P2P nano-grid energy trading platform that integrates prediction outcomes implemented using BD-LSTM and PSO-based optimization mechanisms to meet the real-time energy demands at a minimum cost. The salient contributions of the proposed framework are as follow: • Provision of an intelligent P2P energy trading model that minimizes energy trading cost for consumers and optimal energy sharing plan between peers; • Implementation of analytical data module based on data mining methods to reveal important hidden aspects pertaining to energy consumption, energy load and PV generation to beneficiate energy distributors and peers to make informed decisions to increase the consumption of local DER generations by early prediction of important energy attributes; • The optimal energy trading cost strategy is implemented using an objective function that takes the actual and predicted values of energy load and returns the minimized cost by implementing the PSO-enabled optimization method; • An intelligent time-aware energy sharing plan is devised, which decides the role of nanogrids as prosumer or consumer and prefers the use of PV generated energy over grid energy for local trading; • The optimal energy sharing mechanism also handles charging and discharging operation of ESS to manage the excess power efficiently; • The significance of the proposed model is validated by presenting a case study wherein data of 12 nanogrid is obtained from the residential community of Jeju City, South Korea. The remainder of the paper is structured as follows. Section 2 illustrates the system model for the architecture. Section 3 provides the simulation results carried out by considering a case study encompassing the date of nanogrid houses. Finally, section 4 concludes the paper and highlights the successful contributions of the proposed study.

II. METHODOLOGY
This section encompasses methods employed to implement the proposed energy trading for optimal P2P energy exchange within a nanogrid cluster. The considered data set of 12 nanogrid houses that contain rooftop PV panels to meet energy requirements of energy appliances. The overall structure of the proposed model is Fig. 1.
Firstly, energy data of all the nano-grid houses is thoroughly analyzed to grasp their individual behavior. The data values of the parameters contained some missing records which was addressed using kNN imputation method. The analysis outcomes are detailed discussed in section 3. We have considered the SMP cost and DR cost data provided by (KEPCO) for energy cost data.The analyzed parameters are passed to the prediction module, which implements BD-LSTM model to predict energy load, energy consumption, PV generation, and electricity cost. As mentioned earlier, this study focuses on optimizing two important aspects related to energy trading, (1) optimizing energy trading cost and (2) optimal energy exchange plan among nanogrid houses connected within a cluster. The actual and predicted energy parameters also serve as an input to the optimization modules.
Each nanaogrid contains a smart meter that monitors, records, and transmits information pertaining to energy load demand and PV power production.

A. NANOGRID P2P ENERGY TRADING NETWORK
This section delineates details regarding the power management of a nanogrid cluster (i.e., connected nanogrids) used within the P2P energy trading framework. Each nanogrid in the network is assigned a role as a consumer or prosumer prior to implementing the proposed optimization modules. Thus, energy ''sell'' or ''buy'' trade mode is enabled prior to initiating the trading process. To initiate energy trading among peers, the first thing is to ensure the supply-demand relationship between nanogrids. Once the relationship is ensured, the nanogrid can trade energy in a peer-to-peer fashion. Nanogrids rely on two energy resources, utility, and PV, to fulfill their energy requirements. All the nanogrids in the network are connected to the utility grid in the form of point of common coupling (PCC). The utility grid is employed to fulfill energy requirements when a local cluster fails to meet energy requirements due to unfavorable conditions incurred by the renewable. On the other hand, when a nearby nanogrid fulfills its energy requirements and holds surplus energy produced by PV, the energy could be sold out among connected nanogrids in a peer-to-peer manner.

B. BIDIRECTIONAL LONG SHORT-TERM MEMORY (BD-LSTM) FORECASTING MODEL
Energy parameters encompassing energy loads, energy consumption, PV generation, and energy cost are predicted using BD-LSTM model. We believe that prediction of such crucial energy parameters can play an influential role in revealing useful time-series based hidden patterns in the data to beneficiate in the applications pertaining to future energy demands. First, let us explain the detailed structure of conventional LSTM. It holds a particular memory cell to store the time-stamp-based information, which provides LSTM with an additional ability than conventional RNNs [35]. A plethora of existing studies has proven the significance of prediction models in energy applications in terms of early forecasting leading to maximum welfare. For instance, in the context of the proposed study, P2P energy trading based on forthcoming load requirements and PV power production is performed based on the assumption that it may result in more costefficient P2P electricity trading. Let us first explain the basic structure of BD-LSTM. Unlike LSTM, BD-LSTM trains two models wherein one model learns the pattern of input and later learns the reverse of the pattern. The multi-layer LSTM model of a cell at layer l and time k in the forward direction is executed using equations (1-6). The following equations represent the gates that are part of LSTM, which transforms it into BD-LSTM.
hidden state: In the above equations (1-4), X l represents weight metrics among layer's cell (l-1), and Y l represents weight matrices among continuous cells of layers l, and C l represents the bias vector of each layer. The weight matrices and the bias values of the cells are broadcasted with the length of the sequence VOLUME 10, 2022 FIGURE 1. Architecture of predictive optimization based energy cost minimization and energy sharing plan for peer-to-peer nanogrid.
to reduce the number of hidden neurons and weights in the network. The ''*'' symbol in equations (5-6) depicts elementwise multiplication. The BD-LSTM traverses the information in two directions, forward and backward, which is done by harnessing two separate LSTM layers. The hidden state for the forward direction is computed using equation 6. Similarly, the same formula is employed to calculate the backward hidden state and traversed in the backward direction.
In equation 7, l represents the input layer. Compared to LSTM, BD-LSTM can interpret the association between elements in the full sequence by processing the information in both directions. In addition, the parameters sharing method employed by BD-LSTM consumes less memory than the conventional CNN and DNN; therefore, in this study, we employ BD-LSTM as a forecasting model to predict load demands and energy consumption, PV generation, and energy cost.
The model comprises six hidden layers. We employ the trial and error technique [52] to determine the parameters to the input layer and the number of hidden layers in the BD-LSTM model. The number of inputs and outputs to be passed to the prediction model is decided by evaluating the root-meansquared error (RMSE). The input layer of BD-LSTM model takes the input of load as L(k-i) to L(k), which returns the output as L(k+i) wherein i=1, 2. . . , m. ADAM optimizer is harnessed to find the weights and accuracy at each epoch. RMSE measure is considered a log loss function that validates the proposed model's performance, computed using equation 9. A denotes the actual predicted value, and P denotes the same predicted value in time interval t, wherein t is from 1 to k.

C. MINIMIZE NANOGRID ENERGY TRADING COST
This section explains the objective function proposed to reduce nanogrid cost for consumers. The objective function is implemented using PSO, as shown in the architecture diagram Fig.1 1. The objective function considers the actual and predicted loads to reduce energy trading cost. Table 1 illustrates the acronyms used in the two optimization modules.
The constraints on equation 10 represent the relationship b/w total load in an interval and energy to an individual consumer for energy trading. where, Equation 13 represents the final energy of mth consumer at the end of the interval which would not be greater than the permissible energy.
The constraints shown in equation 14 specify the lower and upper bound of energy flow for consumers.

D. ENERGY EXCHANGING MECHANISM
The nanogrids connect to the utility grid via BD-DC-AC converters so that energy remains balanced. If a nanogrid holds surplus energy, the converter will turn on its inverter mode and send the remaining energy back to the utility grid.
In the opposite situation, the converter would feed the energy from the utility grid. The proposed energy exporting and importing strategy is shown in Fig. 2. Each of the modules is explained in this section. Let NG be a set of nanogrids in the proposed energy trading network and n be number of nanogrids. N G 2 , . . . , N G n } Let ±1 be a value used for energy selling and buying. For instance, if a nanogrid is assigned ''+1'', it shows that the nanogrid has an exceeding energy (i.e., surplus energy) that can be sold to other nanogrids in the network/cluster. Similarly, ''−1'' indicates that a nanogrid does not hold adequate energy to fulfill its demands and needs requires energy from connected nanogrids (first priority) or the utility grid. Let ESS represents a set of energy storage system installed in each nanogrid. For instance, ESS = {ess 1 , e ss 2 , . . . , ess n } where n represents total number of ESS which would be same as number of nanogrid houses.
Let t be a timespan and D be the load demand. Thus, D k (t) represents the load demand of k th nanogrid at time t. Similarly, let PV k (t) be the energy generated by photovoltaic (PV) of k th nanogid at time t, which can either be employed to charge ess k or to meet D k (t). In addition, the surplus energy produced by PV is utilized for selling to other NG in need. The self-supplied energy generated by PV to meet loads demand of its nanogrid is referred as: The ESS unit comprises batteries used to store energy generated by PV, and a bi-directional DC-DC converter. The energy remained in ess at time-span t is termed as, R k (t). Both the factor decides decision taken for ess charging, i.e, D k (t) and PV k (t) and the energy traded with other nanogrids.
The following scenarios are being considered for P2P energy trading.
• If trading function= +1: The preference for energy exporting would be given to PV, i.e., surplus energy produced by PV k (t). And, if there is no surplus energy, then the energy stored in ess k will be used for trading.
• If trading function= −1: The bought energy can only be utilized to supply, D k (t), not to be stored in ess k . The energy remained after energy trading at time interval t is denoted as: r e 1 (t), . . . , r e n (t)} wherein re shows energy remained in es of k nanogrid at time t. The re holds constraint depending on ess capacity. VOLUME 10, 2022 The constraint is: re min,k ≤ re k (t) ≤ re max,k re (max,k) is the total capacity of ESS in (kWh) and re (min,k) is the minimum energy of ess fixed by DoD to evade from excessive discharging.
The energy shared by each nanogrid is termed as, S k (t), which denotes the shared energy by k th nanogrid at time t. S k (t) will be employed as a decision factor for energy trading. The shared energy also assists in determining the amount of surplus energy of the respective nanogrid. For instance, if the shared energy is greater than zero, the trading function will become +1, otherwise become −1. Following are the constraints imposed for energy sharing. Similarly, surplus energy generated by PV is termed as, The following function specifies the energy value to be traded.
The value of Surplus max,k is determined based on two factors: (1) Maximum amount of energy in ess k at time t, determined by the rated power of the DC-DC. converter, and (2) re max,k .
The discharged energy from ess k , used to meet the energy load for k nanogrid, is termed as: DE max,k , is maximum energy discharged from ess k within time-span t, that is determined by the remained energy of es and rated power of BD-DC-DC converter. The equations that decide the energy flow of +−1, is designed as follows: For energy buying (i.e., +1), ess k must follow these two conditions: In contrast to the conditions mentioned for NG = +1, for NG = −1, ess k cannot operate during charging. Various operational constraints are imposed according to energy consumption and available energy of nanogrids. For NG = +1, the traded energy (TE) is termed as: Equation 18 holds the following constraints: The total energy shared by +1 nanogrid must not exceed the total energy required by −1 nanogrid, whereas, the shared energy that is (−1) nanogrid buys from (+1) cannot exceed their energy available for selling.

III. CASE STUDY
To verify the experiments, we employ a data set of 12 nanogrids from the residential community of Jeju City, South Korea. The data is obtained from smart meters installed in the nanogrids, intermingled with other requisite parameters to implement the proposed model. It is assumed that the smart meter can control and monitor the energy operation of all the loads and devices. The smart meter contains current signals and raw voltages. The energy consumed by a nanogrid is calculated via discrete signals. Table 2 presents an overview of the employed energy data that contains energy load and PV generation data produced daily and weekly by the houses and their respective discharging power (kW). The minimum SoC level of the ESS system is 30%, and PV capacity is 2.5 kWp. The simulation is conducted in MATLAB. Contemplating a situation where the considered NGs hold a minimum geographical distance, the PV of 12 NGs would have similar data obtained from the actual installed rooftop PV.

A. DATA ANALYSIS
This section delineates the outcomes attained by performing descriptive analysis on the energy data. The weekly-based analysis is performed on the data set of the considered nanogrid houses in the following ways: (1) energy consumption analysis, (2) energy load analysis, (3) PV generation analysis, and (3) energy cost analysis.

1) ENERGY CONSUMPTION
This section delineates the energy consumption analysis of the considered nanogrid homes that can act as a consumer or prosumer based on their energy consumption and load. The home appliances encompassing all the loads have their power rating while operating. Fig. 3 shows the average energy consumption analysis for each day of a week. Overall, the houses exhibit an identical energy consumption behavior.
The NG-2 has a minor daily consumption, i.e., around 3 kWh, and NG-10 has the highest energy consumption of around 32 kWh compared to other houses.

2) ENERGY LOAD
Similar to the analysis performed for energy consumption (shown in Fig. 4). Overall, the NG-10 has the highest value of energy load, i.e., 32.2 kW, and NG-4 holds the lowest energy load of 2.6 kW, followed by NG-3 with around 5.9 kWh weekly. The same can be seen for each day of the week while the rest of the houses have moderate energy loads.

3) PV GENERATION ANALYSIS
An analysis of energy generated from photovolatic (PV) arrays is considered to grasp the behaving pattern of PV generation in different days of a week entirely depending on  the weather condition. Fig. 5 shows the PV energy generation analysis for seven days of a week of all the considered NGs. It is evident from the figure that NG3 exhibits the lowest value of PV energy generation, i.e., around 8.47 KWh, followed by NG-4, NG-11, NG-7, N-12, and reaching the highest PV generation value produced by NG-8 of about 10.86 kWh. The weekly ratio delineates the lowest value as 59.33 kWh by NG-5 and maximum by NG-6 at around 76 kWh.

4) ENERGY COST ANALYSIS
Electricity cost data considered in this study is taken from the demand response program (DR) proposed by the Korea Electric Power Corporation (KEPCO). DR scheme provides incentives to those consumers who utilize less energy during peak hours. The DR scheme helps in reducing power plan emission, enhancing the reliability of power systems, and less reliance upon overseas fuels [51]. The Korea Electric Power Corporation (KEPCO) determines the electricity rate  using DR program. The DR program specifies the rate for the energy supplied by the utility grid. The electricity price determined by DR scheme ranges in $0.05/kWh for 23:00-09:00 time intervals, $0.1/kWh for 9:00-10:00, 12:00-13:00, 17:00-23:00 time intervals, and $0.18kWh for 10:00-12:00, 13:00-17:00 time intervals, as visualized in Fig. 6. Similarly, energy trading rate specified by renewable energy certificates and system marginal price (SMP) is determined by Korea Power Exchange (KPX) [23].

B. PREDICTIVE ANALYSIS
Prediction models play a substantial role in revealing implicit knowledge or hidden pattern of the data and exploit that knowledge to devise effective policies [34], [44]- [47]. For training, BD-LSTM uses a 10-fold cross-validation technique to predict energy load, energy consumption, PV generation, and energy cost, as shown in Fig. (7-10), respectively. The figures show the actual and predicted values for the said four  predictive analyses. The prediction outcomes were attained using RMSE (see equation 8). We have observed the individual and predicted results for all the predictions, as shown in Table 3. The figures exhibit a difference between actual and predicted outputs. The best value of RMSE is reported for PV generation prediction (1.26), followed by energy load (1.45) and energy consumption (1.98). Overall, the value of RMSE signifies good prediction behavior that can positively impact the energy-oriented prediction models and energy provider entities to form effective decision-making. The accurate estimation of energy load, energy consumption, and PV generation can help in the future for resource and load optimization as per a certain time.

C. ENERGY COST OPTIMIZATION
This section encompasses the outcomes attained by implementing the PSO-enabled energy cost objective function (explained in section 3). Fig. 10 shows the energy cost results  in three aspects: (1) actual energy cost, predicted energy cost, and optimized energy cost. The X-axis shows the timestamp information, i.e., days of the week, and the y-axis shows energy price in the dollar ($). The actual energy cost data is obtained from the SMP/DER, as explained in [44]. The graph exhibits average values computed for all the 12 nanogrid houses in the proposed energy trading framework. Predicted energy price may help in taking on-time decisions related to energy cost before trading. Predicting energy prices is helpful for individual prosumers and consumers to predict future market trends. Likewise, the optimal energy price is computed based on the objective function to find the optimal energy price. It is estimated from the graph that the PSO-based optimization function finds the optimal real-time energy price in between the original and predicted energy price. It can be inferred that optimal energy price can help in achieving the optimized real-time energy cost used in energy trading systems.

D. PERFORMANCE ANALYSIS OF ENERGY EXCHANGING MECHANISM
This section encompasses the results attained by simulations considered for 12 nanogrids, as shown in Fig. 11, 12 and 13 (the simulation results of 12 NGs is shown in three parts). The X-axis of the figures (11,12,13) shows ''Days'' of Week and Y-axis shows ''Power(kW)''.
The positive values exhibit that a nanogrid has acted as a prosumer and traded its surplus energy to other connected   nanogrids in the network. In contrast, the negative values indicate that nanogrid has acted as a consumer and bought energy from other NG. It is evident that each nanogrid assumes a varying role amids the simulation. For instance, NG-10 assumed the consumer role as its produced PV energy is not self-sufficient to fulfill its energy requirements. On the other hand, the nanogrids 1, 2, and 4 behaved as a prosumer because load demands of these NGs are less than the respective PV energy; thus the surplus energy is employed for selling to the consumer NGs in need. In addition, the rest of the NGs have assumed alternate roles in the energy sharing process. The roles of NGs entirely depend on their respective produced energy. For instance, if a nanogrid has surplus PV energy, it can act as a prosumer; otherwise, it acts as a consumer NG.  Overall, the outcomes signify that the proposed model can successfully be implemented for small-scale nanogrids, connected in the form of a cluster/network.

IV. CONCLUSION
Excess utilization of fossil-based energy resources is the leading cause of polluting the environment. This problem has made it a primary concern for householders to install renewable energy-based distributed energy resources (DERs) and energy storage systems. This article presented an intelligent energy trading model that contemplates important aspects overlooked by contemporary state-of-the-art in energy trading. We present a predictive optimal energy trading plan that focuses on two main factors: an intelligent time-aware energy sharing plan is formed among nanogrid clusters to decide the role of peers as prosumers and fosters the harnessing of PV generated energy for energy trading within a nanogrid cluster, and an objective function is designed to minimize nanogrid energy trading cost which takes predictive parameters as input and implements objective function using PSO algorithm. The study's outcomes are evaluated using energy parameters of 12 nanogrid houses by conducting simulation. In addition, detailed analysis and prediction of important energy parameters, including energy load, energy consumption, and PV generation, is also performed using the BD-LSTM algorithm, validated using standard evaluation measure RMSE. The prediction outcomes can positively contribute to efficient decision making for smart grid-based systems. The detailed experiments via simulation revealed that the energy sharing plan has a tendency to meet the energy requirements of nanogrid house in the P2P cluster, and energy cost is reduced significantly FAIZA QAYYUM received the M.S. degree in computer science from the Capital University of Science and Technology (CUST), Islamabad, Pakistan, in 2017. She is currently pursuing the Ph.D. degree in computer engineering with Jeju National University (JNU), South Korea. Her research interests include machine learning, data mining, smart grid optimization, web mining, and information retrieval. She has been associated with academia, since last four years, where she has been involved in preparing RD proposals and projects at national and international level.
HARUN JAMIL received the B.Sc. degree in electronic engineering from the Capital University of Science and the M.S.E.E. degree in electrical engineering from Air University, Islamabad, Pakistan, in 2019. He is currently pursuing the Ph.D. degree with the Department of Electronic Engineering, Jeju National University, South Korea. His research interests include the indoor localization, data fusion techniques, nanogrid, energy optimization, and prediction.