## 3 Power Management Scheme of MG with EV Charging/Discharging Scheduling Algorithm
### Multi-Objective Optimization for Power Management of Interdependent MG and EV Fleets
#### 3.2.1 Constraints  
While the EV in the PV-based charging station is interconnected to the electricity network through the bidirectional EV charger having DC-to-AC inverter, the EV can be charged by the power supplied from the utility grid and, PV system installed on the charging station, and discharging of EVs, and can be discharged to stabilize the power network and decrease the operating cost of PV-based charging station by using the discharging power for the local load demand and charging demand of EVs. \[PW_{EV}^{i}(t)=\eta_{ch}\times PW_{ch}^{i}\times O_{ch}^{i}(t)-\frac{1}{\eta_{ dch}}\times PW_{dch}^{i}\times O_{dch}^{i}(t),\ \ \ \forall i,t \tag{11}\]  
\[SOC_{EV}^{i}(t)=SOC_{EV}^{i}(t-1)+PW_{EV}^{i}(t),\ \ \forall i,t \tag{12}\]  
The charging/discharging power and the SOC value of \(i\)-th EV are presented in (11) and (12), where \(PW_{EV}^{i}(t)\) represents the charging/discharging power of \(i\)-th EV at time \(t\), \(\eta_{ch}\) and \(\eta_{dch}\) represent the converter efficiency of the battery of EVs in charging/discharging process, and \(SOC_{EV}^{i}(t)\) represents the SOC value of \(i\)-th EV at time \(t\). The dynamic adjustment of SOC of \(i\)-th EV can be calculated as shown in (12). \[SOC_{min}^{i}\leq SOC_{EV}^{i}(t)\leq SOC_{max}^{i},\ \ \forall i,t \tag{13}\]  
where \(SOC_{min}^{i}\) and \(SOC_{max}^{i}\) are the minimum and maximum SOC value of the \(i\)-th EV for all time intervals, respectively. To maintain the efficient operation and prevent the aging of EV battery, the operating range of SOC is set as 20%-80%, as presented in (13). The EV battery can be protected from overcharging and deep discharging issues. \[O_{ch}^{i}(t)-O_{ch}^{i}(t-1)=D_{ch}^{i+}(t)-D_{ch}^{i-}(t),\ \ \forall i,t \tag{14}\]  
\[O_{dch}^{i}(t)-O_{dch}^{i}(t-1)=D_{dch}^{i,+}(t)-D_{dch}^{i-}(t),\ \ \forall i,t \tag{15}\]  
\[\sum_{t=1}^{T}D_{ch}^{i,+}(t)+D_{ch}^{i-}(t)\leq N^{max},\ \ \forall i,t \tag{16}\]  
\[\sum_{t=1}^{T}D_{dch}^{i,+}(t)+D_{dch}^{i,-}(t)\leq N^{max},\ \ \forall i,t \tag{17}\]  
where \(D_{ch}^{i,+}(t)\) and \(D_{ch}^{i,-}(t)\) represent the positive and negative difference between the previous and the current state of binary variable \(O_{ch}^{i}(t)\) {0,1}, \(D_{dch}^{i,+}(t)\) and \(D_{dch}^{i,-}(t)\) represent the positive and negative difference between the previous and the current state of binary variable \(O_{dch}^{i}(t)\) {0,1}, and \(N^{max}\) represents the maximum initiations of EV's charging/discharging process. In order to decrease the adverse effect of intermittent charging/discharging cycles of EV battery which may incur the reduction in battery capacity and its lifetime [65], the initiations of charging/discharging process of the EV is constrained up to \(N^{max}\). In the PV-based charging station, PV panels with a capacity of about 90 kW is installed on the charging station, and a DC-AC converter is used to supply power to the electricity network via a PV system. For the economical and energy-efficient operation of the PV-based charging station, the produced PV power is used for the local load demand and charging demand of EVs within the maximum PV power generation, as presented in (18), where \(PW_{PV}^{max}(t)\) represents the maximum amount of PV power at time \(t\). \[0\leq PW_{PV,load}(t)\times O_{PV,load}(t)+PW_{PV,EV}(t)\times O_{PV,EV}(t) \leq PW_{PV}^{max}(t),\ \ \forall t \tag{18}\]  
In this study, total electricity load demand of the MG is mainly composed of the local load demand and charging demand of EVs, and the electricity is supplied from the utilitygrid, PV system, and discharging of EVs. In order to prevent excessive power consumption from the utility grid, the following equation is presented. \[PW_{load}(t)+\sum\limits_{i=1}^{I}PW_{ch}^{i}\times O_{ch}^{i}(t)- \left(PW_{PV,load}(t)\times O_{PV,load}(t)+PW_{PV,EV}(t)\times O_{PV,EV}(t)+ \sum\limits_{i=1}^{I}PW_{dch}^{i}\times O_{dch}^{i}(t)\right)\\ \leq PW^{max},\ \ \forall t \tag{19}\]  
where \(PW^{max}\) describes the maximum grid power consumption.