## 2 Problem Formulation
### Optimal Low-Carbon Economic Dispatch of Natural-Gas System Considering P2G
#### 2.2.2 Constraints  
(1) Gas Flow Limits of Gas Wells  
\[Q_{wn}^{\text{min}}\leq Q_{wn}(t)\leq Q_{wn}^{\text{max}} \tag{13}\]  
where \(Q_{wn}^{\text{min}}\), \(Q_{wn}^{\text{max}}\) represent the minimum gas flow and the maximum gas flow of gas well \(n\), respectively. (2) Gas Pressure Limits of Gas Nodes  
\[M_{i}^{\text{min}}\leq M_{i}(t)\leq M_{i}^{\text{max}} \tag{14}\]  
where \(M_{i}(t)\) represents gas pressure of gas node \(i\) at time \(t\). \(M_{i}^{\text{min}}\) and \(M_{i}^{\text{max}}\) are the minimum and maximum gas pressure of gas node \(i\). (3) Gas Flow Equation of Pipelines  
The natural-gas system satisfies the mass conservation law of fluid dynamics and Bernoulli equation in the operation. The relationship between gas flow of pipelines and gas pressure of gas nodes can be modeled as follows [12;35]. \[Q_{ij}(t)\big{|}Q_{ij}(t)\big{|}=C_{ij}\Big{(}M_{i}(t)^{2}-M_{j}(t)^{2}\Big{)} \tag{15}\]  
\[Q_{ij}(t)=\frac{Q_{ij}^{in}(t)+Q_{ij}^{out}(t)}{2} \tag{16}\]  
where \(Q_{ij}(t)\) is the average gas flow of pipeline _ij_ (Pipeline _ij_ is the pipeline between gas node \(i\) and gas node \(j\)); \(Q_{ij}^{in}(t)\) and \(Q_{ij}^{out}(t)\) are the injection and withdrawal gas flow of pipeline _ij_, respectively; \(C_{ij}\) is a constant related to the length, diameter, temperature and compressibility factor of pipeline _ij_. (4) Line Pack Equation  
Due to the compressibility of natural gas, the injection gas flow and the withdrawal gas flow of the same pipeline would be different. Some excess natural gas can be stored in the pipelines, which is called line pack. The line pack of pipeline _ij_ is related to the average pressure and its own parameters of pipelines, which can be modeled as below [12;15]. \[L_{ij}(t)=\omega_{ij}M_{ij}(t) \tag{17}\]  
\[M_{ij}(t)=\frac{M_{i}(t)+M_{j}(t)}{2} \tag{18}\]  
\[L_{ij}(t)=L_{ij}(t-1)+Q_{ij}^{in}(t)-Q_{lj}^{out}(t) \tag{19}\]  
where \(L_{ij}(t)\) is the line pack of pipeline _ij_ at time \(t\); \(\omega_{ij}\) is a constant related to pipeline parameters, gas constant, compressibility factor, gas density, and gas temperature. (5) Nodal Gas Flow Balance EquationFor each gas node, the gas flows into the node must equals the gas flows out of the node. \[ \begin{array}{l}\sum\limits_{n\in i}Q_{wn}(t)+\sum\limits_{m\in i}Q_{gs,m}(t)+ \sum\limits_{k\in i}Q_{P2G,k}(t)-\sum\limits_{j\in Set_{-}I(i)}Q_{ij}^{in}(t)\\ +\sum\limits_{j\in Set_{-}O(i)}Q_{ij}^{out}(t)-Q_{GT,i}(t)-Q_{Li}(t)=0\end{array}  \tag{20}\]  
where, the first three items are the gas flow of gas wells, gas storage, and P2G located at gas node \(i\) at time \(t\), respectively; \(Q_{GT,i}(t)\) and \(Q_{Li}(t)\) indicate the gas flow injected to gas-fired units and the gas load at gas node \(i\) at time \(t\), respectively; \(Set\_{i}\)_(\(i\)) is the set of pipeline \(ij\) which lets gas node \(i\) as the input node; \(Set\_{O}(i)\) is the set of pipeline \(ij\) which lets gas node \(i\) as the output node. (6) Gas Flow Limits and Capacity Limits of Gas Storage  
\[Q_{gs,m}^{\min}\leq Q_{gs,m}(t)\leq Q_{gs,m}^{\max} \tag{21}\]  
\[V_{m}^{\min}\leq V_{m}(t)\leq V_{m}^{\max} \tag{22}\]  
\[V_{m}(t)=V_{m}(t-1)+Q_{gs,m}(t) \tag{23}\]  
where \(Q_{gs,m}^{\min}\) and \(Q_{gs,m}^{\max}\) are the minimum and maximum gas flow of gas storage \(m\), respectively; \(V_{m}(t)\), \(V_{m}^{\min}\), \(V_{m}^{\max}\) are the capacity of gas storage \(m\) at time \(t\), the minimum and maximum capacity of gas storage \(m\), respectively. When the gas is injected to the gas storage, \(Q_{gs,m}(t)\) is positive, otherwise it is negative. (7) Compressor  
The compressors are used to boost the pressure of the natural-gas network, which can help the natural gas transporting to each gas load. In this paper, the energy consumed by the compressors is calculated by using natural gas flow through the compressors. The consumed gas flow of compressor \(r\), \(Q_{cr}^{consume}(t)\), is calculated as presented below [15].