## 2 Day-ahead Scheduling Model for EGHS
### Heating Network Model  
In the heating network, the water flow is mostly used as the heat medium. The dynamic characteristics of the heat network are mainly reflected in the heat transfer delay and temperature loss.  
Therefore, in the heating network model, the water flow rate is regarded as constant, and the heating network dynamic characteristics are described as follows:  
\[\frac{\partial T_{k,t}^{x}}{\partial t}+\frac{G_{k,t}^{x}}{\pi\rho_{w}R_{k}^{2}} \frac{\partial T_{k,t}^{x}}{\partial x}+\frac{2\mu_{k}}{c_{w}\rho_{w}R_{k}} \Big{(}T_{k,t}^{x}-T_{k,t}^{w}\Big{)}=0 \tag{11}\]  
In the above, \(T_{k,t}^{x}\) and \(M_{k,t}^{x}\) are the water temperature and water flow at the distance from the nozzle \(x\) at time \(t\) of the \(k\)-pipe. \(\mu_{k}\) is the heat loss factor, and \(c_{w}\) is the specific heat capacity of the water. \(\rho_{k}\) is the density of water and \(R_{k}\) is the radius of the pipe. \(T_{k,t}^{w}\) is the ambient temperature of the \(k\) pipe at time \(t\).  
Solving Equation (11):  
\[T_{k,t}^{\text{out}}=T_{k,t}^{w}+\Big{(}T_{k,t}^{\text{in}}-T_{k,t}^{w}\Big{)} \exp\left(-\frac{2\mu_{k}\Delta\tau_{k}}{c_{w}\rho_{w}R_{k}}\right) \tag{12}\]  
In the above, \(T_{k,t}^{\text{in}}\) and \(T_{k,t+\Delta\tau_{k}}^{\text{out}}\), are the water inflow and outflow temperatures of the \(k\)th pipe at time t. \(\Delta\tau_{k}\) is the time it takes for water to pass through the \(k\)-pipe.  
The water flow can be regarded as a constant, so the above construction can be converted into the following form:  
\[\Delta\tau_{k}=\frac{\pi\rho_{w}L_{k}R_{k}^{2}}{M_{k}} \tag{13}\]  
In the above, \(L_{k}\) is the length of the \(k\) pipe and \(M_{k}\) is the water flow of the \(k\) pipe.  
The electrical and heating output relationship of the CHP unit can be expressed as follows:  
\[P_{c,t}^{\text{chp}}=k_{c}^{\text{chp}}H_{c,t}^{\text{chp}} \tag{14}\]  
\[H_{c,t}^{\text{chp}}=cM_{c}^{\text{chp}}\Big{(}T_{c,t}^{s}-T_{c,t}^{r}\Big{)} \tag{15}\]  
In the above, \(k_{c}^{\text{chp}}\) is the unit's electric-to-heat ratio and \(H_{c,t}^{\text{chp}}\) is the CHP unit's heat output. \(M_{c}^{\text{chp}}\) is the water flow. \(T_{c,t}^{s}\) is the water supply temperature. \(T_{c,t}^{r}\) is the return water temperature.  
Heat exchange station constraints are as follows:  
\[H_{h,t}^{\text{hes}}=cM_{h}^{\text{hes}}\Big{(}T_{h,t}^{s}-T_{h,t}^{r}\Big{)} \tag{16}\]  
Heating network node water temperature constraints:  
\[\sum_{b\in\Omega_{\text{pipe,out,}k}}\Big{(}c_{w}M_{b,t}^{\text{pipe}}T_{b,t }^{\text{rout}}\Big{)}=c_{w}T_{\text{mix},k}\sum_{b\in\Omega_{\text{pipe,out, }k}}M_{b,t}^{\text{pipe}} \tag{17}\]  
\[T_{\text{mix},k}=T_{b,t}^{\text{in}}\quad b\in\Omega_{\text{pipe,in,}k} \tag{18}\]  
In the above, \(\Omega_{\text{pipe,out,}k}\) and \(\Omega_{\text{pipe,in,}k}\) are the collections of pipes with node \(k\) at the outflow point and the inflow point, respectively. \(T_{\text{mix},k}\) is the mixing temperature of node \(k\).  
The water temperature of the water supply network and the backwater network meet the following constraints:  
\[\left\{\begin{array}{l}T_{s}^{\text{min}}\leqslant T_{k,t}^{\text{in}}\\ T_{k,t}^{\text{in}}\leqslant T_{s}^{\text{max}}\\ T_{s}^{\text{min}}\leqslant T_{k,t}^{\text{out}}\\ T_{k,t}^{\text{in}}\leqslant T_{s}^{\text{max}}\end{array}\right. \tag{19}\]\[\left\{\begin{array}{l}T_{r}^{\min}\leqslant T_{k,t}^{\min}\\ T_{k,t}^{\min}\leqslant T_{r}^{\max}\\ T_{r}^{\min}\leqslant T_{k,t}^{\rm{out}}\\ T_{k,t}^{\rm{out}}\leqslant T_{r}^{\max}\end{array}\right. \tag{20}\]  
In the above, \(T_{s}^{\max}\) and \(T_{s}^{\min}\) are the upper and lower limits of the water temperature of the water supply network, respectively. \(T_{r}^{\max}\) and \(T_{r}^{\min}\) are the upper and lower limits of the water temperature of the backwater network.  
The dynamic model of the heating network can be used to describe the operating characteristics more accurately. The heating energy stored in the pipe can be used as the energy buffer of EGHS, which increases the flexibility of scheduling [19].