## 3 Power Management Scheme of MG with EV Charging/Discharging Scheduling Algorithm
### Proposed EV Charging/Discharging Scheduling Algorithm  
In the conventional EV charging/discharging scheduling algorithm, maximum amount of the discharging power from parked EVs is given depending on the specific condition relevant to the difference between local load demand and PV power production, as presented in (9). The determined maximum amount of discharging power is considered for the EV  
Figure 6: Prediction of local load demand and PV power production: (**a**) GRU network architecture; (**b**) GRU cell.  
charging/discharging scheduling in the power management scheme using multi-objective optimization.  
\[\left\{\begin{array}{l}0\leq\sum\limits_{i=1}^{I}PW_{dch}^{i}\times\mathcal{O}_{ dch}^{i}(t)<PW^{dch,max(1)}\quad if\ PW_{load}(t)-PW_{PV}(t)\geq PW^{flag}\\ 0\leq\sum\limits_{i=1}^{I}PW_{dch}^{i}\times\mathcal{O}_{dch}^{i}(t)<PW^{dch,max( 2)}\quad if\ PW_{load}(t)-PW_{PV}(t)<PW^{flag}\end{array}\right. \tag{9}\]  
where \(PW^{flag}\) is the flag parameter to decide the period that discharging of EVs is more or less activated, and \(PW^{dch,max(1)}\) and \(PW^{dch,max(2)}\) are the maximum amount of discharging power from parked EVs in each circumstance. \(PW^{dch,max(1)}\) has higher value than \(PW^{dch,max(2)}\), which means discharging of EVs can be more utilized to the power management of the MG with \(PW^{dch,max(1)}\) than with \(PW^{dch,max(2)}\). If the difference between local load demand and PV power output at the \(t\)-th time interval \(PW_{load}(t)-PW_{PV}(t)\) is equal to or bigger than \(PW^{flag}\), the maximum amount of discharging power of EVs becomes \(PW^{dch,max(1)}\). On the contrary, if it is smaller than \(PW^{flag}\), the maximum amount of discharging power of EVs becomes \(PW^{dch,max(2)}\). In the proposed EV charging/discharging scheduling algorithm, the maximum amount of discharging power of EVs is determined depending on the following conditions.  
\[\left\{\begin{array}{l}0\leq\sum\limits_{i=1}^{I}PW_{dch}^{i}\times\mathcal{O} _{dch}^{i}(t)<PW^{dch,max(1)}\quad if\ \sum\limits_{k=0}^{K}\left(PW_{load}(t+k)-PW_{PV}(t+k)\geq(K+1)\times PW^{flag} \\ 0\leq\sum\limits_{i=1}^{I}PW_{dch}^{i}\times\mathcal{O}_{dch}^{i}(t)<PW^{dch, max(2)}\quad if\ \sum\limits_{k=0}^{K}\left(PW_{load}(t+k)-PW_{PV}(t+k)\geq(K+1)\times PW^{flag} \end{array}\right.\right. \tag{10}\]  
For the power management of the MG, the current and future states of local load demand and PV power production are used to determine the maximum amount of discharging power of EVs. By considering the future trends of local load demand and PV power production, a more appropriate charging/discharging operation can be allocated to each parked EV in a specific circumstance. The future states of local load demand and PV power production are forecasted by the GRU network, trained with each training dataset, as presented in Section 2. If the cumulative sum of difference between local load demand and PV power production from the time interval \(t\) to \(t+K\sum_{k=0}^{K}(PW_{load}(t+k)-PW_{PV}(t+k))\) is equal to or bigger than \((K+1)\times PW^{flag}\), the maximum amount of discharging power from parked EVs becomes \(PW^{dis,max(1)}\). On the contrary, if it is smaller than \((K+1)\times PW^{flag}\), the maximum value of discharging power becomes \(PW^{dis,max(2)}\).