## 2 System Model Formulation
### Prediction of Local Load Demand and PV Power Production  
In the system architecture, parked EVs in the PV-based charging station are utilized as ESS to maintain stable and efficient power system. As shown in Figure 1, the local load demand, the PV system, and the parked EVs are connected to the electrical network, and they can communicate mutually through the communication network. Depending on the forecasted data of the local load demand and the PV power output, the charging/discharging operation of EVs is determined by the system operator, and it can decrease the peak load of the entire system and increase the economic feasibility of the PV-based charging station. The PV power and the scheduled discharging power of EVs can be sold to electric company while providing electricity to the local load demand. When the power is insufficient to satisfy the charging demand and the local load demand, the necessary power is supplied from the utility grid.  
RNN is a kind of ANN that can process time-series data or sequential data, memorizing long term dependencies [61]. However, as time lags increase, the vanishing/exploding gradient problem may occur in the training process of RNN. The structure of LSTM and GRU were proposed to resolve the above-mentioned problem. The GRU is presented to obtain better performance in the aspect of computational time and cost, compared with the LSTM. In this work, the GRU network is utilized to predict the variation trends of the local load demand and PV power output. As shown in Figure 6a, the applied GRU network is mainly composed of two parts: 6 GRU layers and 3 fully connected layers. The appropriate structure of GRU network is established by trial-and-error process [62]. The structure of GRU cell is presented in Figure 6b. In the GRU cell, there exist two control gates, namely update gate (\(z_{t}\)) and reset gate (\(r_{t}\)). The update gate regulates how much the hidden state information at prior time step (\(h_{t-1}\)) will be delivered to the current time step \(t\). The more update gate is activated, the more hidden status information at the previous time step is reflected. The reset gate controls how much the hidden state information at prior time step will be discarded before delivered to the current time step \(t\). The smaller the reset gate, the more information at prior time step is ignored [63].  
To construct the forecast model, the GRU networks are trained with the 1-year dataset of the local load demand and PV power production, respectively. The dataset of the local load demand is obtained from the KPX, and the dataset of the PV power output generated from the PV panel is calculated based on the following components, such as solar irradiances and ambient temperatures, provided from the KMA [64]. Each dataset is split into a training set (80%) and a validation set (20%). The GRU network is trained with each dataset, in other words, the first network is trained with local load demand dataset, the second with PV power output dataset. To reflect the variational trend of the local load demand and the PV power output with power management scheme, the numbers of inputs and outputs are set as 12 and 7, respectively. In the GRU network, \(PW(t-m)\), \(PW(t-m+1)\),..., and \(PW(t)\) are the inputs of local load demand or PV power output at \(t\)-th time interval where \(m=11\), and \(PW(t+1)\), \(PW(t+2)\),..., and \(PW(t+n)\) can be the outputs of local load demand or PV power output at \(t\)-th time interval where \(n=7\). The performance of the forecast model for the local load demand and the PV power output is evaluated by root-mean-squared-error (RMSE). The RMSE is defined as \(\sqrt{\frac{1}{N}\sum_{i=1}^{N}\left(\hat{X}_{i}-X_{i}\right)^{2}}\), where \(\hat{X}_{i}\) represents the predicted value of local load demand and PV power output, and \(X_{i}\) represents the real value of local load demand and PV power output. The RMSE of the forecast model is 3.8 and 6.74 for each validation dataset.