## 3 Mathematical Formulation
### Second Stage: Joint Restoration Scheme
#### 3.2.4 Operational Constraints of Fleet Vehicles  
If \(E_{e}\) is a binary variable which represents the choice to build an FEVCS at the candidate location node \(e\), then \(\gamma_{e,s}\) is the binary variable that represents an active node during microgrid formation with an FEVCS installed at node \(e\). Equation (28) is linearized using (29)-(31).  
\[\gamma_{e,s}=Ar_{e,s}\times E_{e,s},\;\forall e,s \tag{28}\]  
\[\gamma_{e,s}\leq Ar_{e,s},\;\forall e,s \tag{29}\]  
\[\gamma_{e,s}\leq E_{e,s},\;\forall e,s \tag{30}\]  
\[\gamma_{e,s}\geq E_{e,s}+A_{e,s}-1,\;\forall e,s \tag{31}\]  
Similarly, \(\alpha_{f,e,t,s}\) connects the active EVCS node to the fleet vehicle's movement along the grid. The variable \(G_{f,ee,t,s}\) represents the active arc \(ee\) of the fleet vehicle \(f\) at a time \(t\) in the scenario, where \(s\) means that the vehicle is connected to a node \(e\) of the TSN. Constraint (32) is linearized using (33)-(35).  
\[\alpha_{f,e,t,s}=\gamma_{e,s}\times G_{f,ee,t,s},\;\forall f,s \tag{32}\]  
\[\alpha_{f,e,t,s}\leq\gamma_{e,s},\;\forall f,s \tag{33}\]  
\[\alpha_{f,e,t,s}\leq G_{f,ee,t,s},\;\forall f,s \tag{34}\]  
\[\alpha_{f,e,t,s}\geq G_{f,ee,t,s}+\gamma_{e,s}-1,\;\forall f,s \tag{35}\]  
The charging and discharging of fleet vehicles are represented by Constraints (36)-(47). Constraints (36) and (37) restrict the charging and discharging of fleet vehicles to happen only at an active node with FEVCS when the vehicle is on the arc \(e-e\). Constraints (38)-(40) control the charging or discharging of vehicles over a period of time. Constraint (41) defines a single variable that represents the power transfer of the fleet vehicle. Constraint (42) represents the apparent power limit of the fleet vehicles.  
\[0\leq P^{FV,ch}_{f,e,t,s}\leq\alpha_{f,e,i,s}\times P^{EVCS,max}_{e},\;\forall f,t,s \tag{36}\]  
\[0\leq P^{FV,ch}_{f,e,t,s}\leq\alpha_{f,e,i,s}\times P^{EVCS,max}_{e},\;\forall f,t,s \tag{37}\]  
\[0\leq P^{FV,ch}_{f,e,t,s}\leq Y^{ch}_{f,e,s}\times P^{EVCS,max}_{e},\;\forall f,t,s \tag{38}\]  
\[0\leq P^{FV,ch}_{f,e,t,s}\leq Y^{ch}_{f,e,s}\times P^{EVCS,max}_{e},\;\forall f,t,s \tag{39}\]  
\[Y^{chch}_{f,t,s}+Y^{ch}_{f,t,s}\leq\alpha_{f,e,i,s},\;\forall f,t,s \tag{40}\]  
\[P^{FV}_{f,e,t,s}=\frac{P^{FV,ch}_{f,e,t,s}}{\eta^{ch}}-\eta^{ch}P^{FV,ch}_{f,e, t,s},\;\forall f,t,s \tag{41}\]\[\left\|P^{FV}_{f,\ell,s,t}\right.\left.Q^{FV,dch}_{f,\ell,s}\right\|\leq\alpha_{f, \ell,s}\times S^{FVCS,max}_{f} \tag{42}\]  
The constraints related to the state of charge (SOC) of the fleet vehicles are modeled in (43)-(47). Constraint (43) defines the relationship of the initial SOC of the EV with a SOC of the second hour, which is activated by \(\alpha_{f,\ell,s}\). Constraint (44) defines the relationship of the SOC of the EV when \(t\) is not equal to one. The relationship between the SOC of the EV when the EV is not connected to an FEVCS is shown in (45) and (46). The upper and lower limit of the SOC of the EV is defined in Constraint (47).  
\[-M(1-\alpha_{f,\ell,s})\leq SOC^{FV}_{Initial}-SOC^{FV}_{f,\ell,s}-P^{FV}_{f, \ell+1,s}\leq M(1-\alpha_{f,\ell,t,s}),\ \forall f,t=1,s \tag{43}\]  
\[-M(1-\alpha_{f,\ell,s})\leq SOC^{FV}_{f,\ell-1,s}-SOC^{FV}_{f,\ell,s}-P^{FV}_{f,\ell+1,s}\leq M(1-\alpha_{f,\ell,t,s}),\ \forall f,t\
eq 1,s \tag{44}\]  
\[-M\sum_{e}\alpha_{f,\ell,s}\leq SOC^{FV}_{Initial}-SOC^{FV}_{f,\ell,s}-P^{FV}_{f,\ell+1,s}\leq M\sum_{e}\alpha_{f,\ell,s},\ \forall f,t=1,s \tag{45}\]  
\[-M\sum_{e}\alpha_{f,\ell,s}\leq SOC^{FV}_{f,\ell-1,s}-SOC^{FV}_{f,\ell,s}- \times P^{FV}_{f,\ell+1,s}\leq M\sum_{e}\alpha_{f,\ell,s,},\ \forall f,t\
eq 1,s \tag{46}\]  
\[SOC^{min}_{f}\leq SOC_{f,\ell+1,s}\leq SOC^{max}_{f},\ \forall f,t,s \tag{47}\]