## 2 The RIES Mathematical Model
### Load Model  
With the improvement of the electrification level on the user side, the coupling between electrical, gas and thermal loads becomes closer. By using efficient electric heating equipment and other devices, part of the heat demand and gas demand of the users is replaced with electric energy. As shown in Figure 1, space heating and hot water are partly met by electric heating devices such as the air conditioner, heat pump, etc. At the same time, the differences in user behavior of the electric heating supply have certain impacts on the total demand in the RIES, so the differences between the individual and aggregate demand should be taken into account in the load model. The load side could be characterized as Equation (3):  
\[\left\{\begin{array}{l}L_{\text{e}}(t)=\sum\limits_{n=1}^{N}L_{n}^{\text{e}} (t)=E(t)+\sum\limits_{n=1}^{N}E_{n}^{\prime}(t)\\ L_{\text{h}}(t)=\sum\limits_{n=1}^{N}L_{n}^{\text{h}}(t)=H(t)-\sum\limits_{n=1 }^{N}H_{n}^{\prime}(t)\\ L_{\text{g}}(t)=\sum\limits_{n=1}^{N}L_{n}^{\text{g}}(t)=G(t)\end{array}\right. \tag{3}\]  
where \(L_{\text{e}}(t)\), \(L_{\text{h}}(t)\), \(L_{\text{g}}(t)\) are the aggregate electric, heat, gas load of users at time \(t\), respectively; \(L_{n}^{\text{e}}(t)\), \(L_{n}^{\text{h}}(t)\), \(L_{n}^{\text{g}}(t)\) are the electric, heat, gas loads of user \(n\) at time \(t\), respectively; \(N\) is the number of users; \(E(t)\), \(H(t)\), \(G(t)\) are the direct electric, heat, gas demand of users at time \(t\) respectively which can be predicted through top-down methods such as statistical method with historical data; \(E_{n}^{\prime}(t)\), \(H_{n}^{\prime}(t)\) are the electric demand, heat demand of user \(n\) produced from electric heating supply respectively, which is generally predicted through bottom-up methods that focus on the individual energy requirements of different users in the RIES.  
The electric energy substitution strategy (replacing heat energy with electric energy) is an effective means to improve the load structure and reduce pollution [29; 30] since the load is the basis of energy storage configuration. The change of load structure mainly affects the choice of the RIES operation strategy and the optimization range of power and capacity during the energy storage system configuration. At present, the electric energy substitution has been rarely considered in existing methods of energy storage configuration. The use of EB in the supply side for district heating of the RIES can reduce the use of GB, while P2G devices can convert surplus electric energy into natural gas when the wind power is high and the electric load is low in the evening. The use of P2G and EB can be treated as the electric energy substitution. The P2G and EB devices are considered as loads to establish an equivalent load model:  
\[\left[\begin{array}{c}\overset{\wedge}{L_{\text{e}}}(t)\\ \overset{\wedge}{L_{\text{h}}}(t)\\ \overset{\wedge}{L_{\text{g}}}(t)\end{array}\right]=\left[\begin{array}{c}L_ {\text{e}}(t)\\ L_{\text{h}}(t)\\ L_{\text{g}}(t)\end{array}\right]+\left[\begin{array}{c}P_{\text{P2G}}(t)+P_ {\text{EB}}(t)\\ -\eta_{\text{EB}}P_{\text{EB}}(t)\\ -\eta_{\text{P2G}}P_{\text{P2G}}(t)\end{array}\right] \tag{4}\]  
\[\overset{\wedge}{L}=L+P_{\text{P2G,EB}} \tag{5}\]  
where \(\overset{\wedge}{L_{\text{e}}}(t),\overset{\wedge}{L_{\text{h}}}(t),\overset{ \wedge}{L_{\text{g}}}(t)\) are the equivalent electric, heat, gas load at time \(t\), respectively; \(P_{\text{P2G}}(t),\)\(P_{\text{EB}}(t)\) are the P2G power, EB power at time \(t\) respectively; \(\eta_{\text{P2G}},\)\(\eta_{\text{EB}}\) are the P2G efficiency, EB efficiency respectively; \(\overset{\wedge}{L},\)\(\mathbf{L},\)\(\mathbf{P}_{\text{P2G,EB}}\) are the equivalent load matrix, load matrix, \(\mathbf{P2G}\) and \(\mathbf{EB}\) power matrix.