## 2 Problem Formulation
### Constraints of the Problem
#### 2.3.3 EH Constraints  
In this study, the presented EH includes photovoltaic and wind renewable energy sources, storage, electric parking, CHP, and boilers, and is connected to the electricity, gas, and regional heating network for the ability to deliver/receive energies. The active powers of gas output and heating of the hub are calculated based on Equations (19)-(22).  
\[H_{m,t}^{p}=CHP_{m,t}^{p}+RES_{m,t}+(ST_{m,t}^{p,ch}-ST_{m,t}^{p,ch})+(EV_{m,t} ^{p,ch}-EV_{m,t}^{p,ch})-HD_{m,t}^{p}\hskip 20.0 pt\forall m,t \tag{19}\]  
\[H_{m,t}^{q}=CHP_{m,t}^{q}+ST_{m,t}^{q}+EV_{m,t}^{q}-HD_{m,t}^{q}\hskip 20.0 pt \forall m,t \tag{20}\]  
\[H_{m,t}^{g}=-CHP_{m,t}^{g}+BO_{m,t}^{g}-HD_{m,t}^{g}\hskip 20.0 pt\forall m,t \tag{21}\]  
\[H_{m,t}^{h}=CHP_{m,t}^{h}+BO_{m,t}^{h}-HD_{m,t}^{h}\hskip 20.0 pt\forall m,t \tag{22}\]  
The power balance equation of the CHP is presented in Equation (23) concerning the CHP power boundaries in the gas network (Equation (24)), in the electricity network (Equation (25)), and the heating network (Equation (26)).  
\[CHP_{m,t}^{g}=\frac{\left(CHP_{m,t}^{g}+CHP_{m,t}^{h}\right)}{\eta^{CHP}}\qquad\forall m,t \tag{23}\]  
\[0\leq CHP_{m,t}^{h}\leq CHP_{m}^{h,\max}\qquad\forall m,t \tag{24}\]  
\[\sqrt{\left(CHP_{m,t}^{p}\right)^{2}+\left(CHP_{m,t}^{q}\right)^{2}}\leq CHP_{m }^{e,\max}\qquad\forall m,t \tag{25}\]  
\[0\leq CHP_{m,t}^{h}\leq CHP_{m,t}^{h,\max}\qquad\forall m,t \tag{26}\]  
The constraints related to the storage system are presented based on Equations (27)-(32). These constraints are based on the stored energy (Equation (25)), charge and discharge range (Equations (28) and (29)), primary energy range (Equation (30)), stored energy range (Equation (31)), as the limit of the charger (Equation (32)).  
\[E_{m,t+1}^{ST}=E_{m,t}^{ST}+\eta^{ST,ch}ST_{m,t}^{p,ch}-\frac{1}{\eta^{ST,cht}} ST_{m,t}^{p,chch}\qquad\forall m,t \tag{27}\]  
\[0\leq ST_{m,t}^{p,ch}\leq CR_{m}^{ST}st_{m,t}\qquad\forall e,t \tag{28}\]  
\[0\leq ST_{m,t}^{p,ch}\leq DR_{m}^{ST}(1-st_{m,t})\qquad\forall m,t \tag{29}\]  
\[E_{m,t}^{ST}=E_{m}^{ini}\qquad\forall m,t=1 \tag{30}\]  
\[E_{m}^{\min}\leq E_{m,t}^{ST}\leq E_{m}^{\max}\qquad\forall m,t \tag{31}\]  
\[\sqrt{\left(ST_{m,t}^{p,cht}-ST_{m,t}^{p,ch}\right)^{2}+\left(ST_{m,t}^{q} \right)^{2}}\leq ST_{m}^{\max}\qquad\forall m,t \tag{32}\]  
The constraints related to the parking of EVs are presented as Equations (33)-(38) [25; 26; 27; 28]. The energy stored in the battery of EVs is calculated using Equation (33). The charging and discharging capacity of EVs are defined in Equations (34) and (35). The specification of the battery banks when EVs enter and exit the parking lot can be provided by Equations (36) and (37) and the specification of the EV charger capacity is presented in (38).  
\[E_{m,t+1}^{EV}=E_{m,t}^{EV}+\eta^{EV,ch}E_{m,t}^{p,ch}-\frac{E_{m,t}^{p,cht}}{ \eta^{EV,cht}}\qquad\forall m,t \tag{33}\]  
\[0\leq E_{m,t}^{EV,p,ch}\leq CR_{m,t}^{EV}ev_{m,t}\qquad\forall m,t \tag{34}\]  
\[0\leq E_{m,t}^{EV,p,chch}\leq DR_{m,t}^{EV}(1-ev_{m,t})\qquad\forall m,t \tag{35}\]  
\[E_{m,t}^{EV}=E_{m,t}^{arr}\quad\forall m,t=Arrival\ time \tag{36}\]  
\[E_{m,t}^{EV}=E_{m,t}^{dep}\quad\forall m,t=Departure\ time \tag{37}\]  
\[\sqrt{\left(EV_{m,t}^{p,cht}-EV_{m,t}^{p,ch}\right)^{2}+\left(EV_{m,t}^{q} \right)^{2}}\leq EV_{m,t}^{\max}\quad\forall m,t \tag{38}\]  
In addition, the power balance equation of the boiler and size limits can be defined based on Equations (39)-(40) [18].  
\[BO_{m,t}^{g}=\frac{BO_{m,t}^{h}}{\eta^{BO}}\quad\forall m,t \tag{39}\]  
\[0\leq BO_{m,t}^{g}\leq BO_{m}^{\max}\quad\forall m,t \tag{40}\]  
\(EV^{\max}\) is equivalent to \(\sum_{i=1}^{N_{t}}CC_{i}^{ev}\), which indicates \(CC^{ev}\) is the charging capacity of the EVs. \(E^{arr}/E^{dep}\) is equivalent to \(\sum_{i=1}^{N_{2t}}SOC_{i}BC_{i}/\sum_{i=1}^{N_{3t}}BC_{i}\), in which SOC expresses the state of charge and \(BC\) is the battery capacity of any EVs. \(N_{2t}\) and \(N_{3t}\) also refer to the arrival and departure times of EVs.