## 2 PEF Model for IESs  
### SSEF Calculation in an IES  
The SSEF calculation is the basic step in PEF calculations; similar to the power flow model of power systems, the SSEF model can be expressed using the following equation:  
\[\begin{gathered} p=P_{i}^{s}+P_{i}^{g}-P_{i}^{l}-P_{c}-\sum \limits_{j=1}^{n}P_{ij}=0\\ j\
eq i,\forall i=1,\cdots,n\\ q=Q_{i}^{s}+Q_{i}^{g}-Q_{i}^{l}-P_{c}-\sum\limits_{j=1}^{n}P_{ij}=0 \\ j\
eq i,\forall i=1,\cdots,n\\ f_{NG}=Q_{i}-\sum\limits_{m\in i}f_{im}+\sum\limits_{m\in i}f_{in}+ \sum\limits_{j}G_{ij}F_{j}=0\\ j\
eq i,\forall i=1,\cdots,m\end{gathered} \tag{1}\]  
Here, \(P_{i}^{s}\) and \(Q_{i}^{s}\) are respectively the active and reactive power that the source injects into node \(i\), \(P_{i}^{l}\) and \(Q_{i}^{l}\) are respectively the active and reactive power demanded by the \(i\)_th_ node load, \(P_{i}^{c}\) and \(Q_{i}^{c}\) are respectively the active and reactive power consumed by the compressor, and \(P_{i}^{g}\) and \(Q_{i}^{g}\) are respectively the active and reactive power that the gas generator injects into node \(i\). In addition, \(n\) represents the number of nodes directly connected to the \(i\)_th_ node, \(Q_{i}\) is the injection of natural gas at the \(i\)_th_ node, and \(f_{im}\) and \(f_{in}\) represent the injections at the downstream and upstream nodes, respectively. The gas consumption of the compressor is denoted by \(F_{j}\): when the compressor takes air from node \(i\), the correlation coefficient \(G_{ij}\) is 1; otherwise, \(G_{ij}\) is 0. If the energy required by the compressor comes from the power system, then \(G_{ij}\) is also 0. Finally, \(p\), \(q\) and \(f_{NG}\) represent the active, reactive, and gas flow unbalances in a node.  
The specific calculation of the SSEF and parameters for a natural gas network are discussed elsewhere [10]. This study uses separate Newton iterations to solve the SSEF problem. That is, the SSEFs of the power and natural gas systems are each iterated independently using [PERSON]'s method until convergence is achieved. Then, the unbalanced quantity between these energy systems is iterated through the energy coupling system unit until overall convergence is achieved, as shown in Figure 1.  
The main steps of SSEF computation are as follows:  
Step 1: Initialize the variables with the information of the natural gas network and construct its correlation matrix.  
Step 2: Using the initial pressure of the natural gas network, solve each variable of the natural gas network (such as the pressure of each node and the gas flow of each pipeline) using [PERSON]'s method.  
Step 3: Compute the value of the energy interaction of the natural gas network with the power system in the coupling system, which consists of the gas turbine and compressor.  
Step 4: Construct the nodal admittance matrix of the power system and compute its initial values from the energy interaction obtained in Step 3. Solve the power flow of the power system using [PERSON]'s method and obtain its information, which includes node voltage, active power, reactive power, and voltage phase angle.  
Step 5: Compute the energy interaction value again from the results of Step 4 and then use it to compute the natural gas network information using [PERSON]'s method. Repeat Steps 2-5 until the relative error of the current and previous energy interaction values meets the accuracy requirement (e.g., less than a given tolerance).