# Comprehensive Energy Demand Response Optimization Dispatch Method Based on Carbon Trading
## 3 Carbon-Trading Mechanism
### Carbon Emissions and Carbon Emission Quotas  
The following is an analysis of the carbon emissions and carbon emission quotas of each unit:  
(1) Coal-fired unit  
Figure 1: Integrated energy hub model. The carbon emissions of coal-fired units are related to their output power:  
\[C_{C,j}=\sum_{t=1}^{T}\left(a_{1}P_{C,j,t}^{2}+b_{1}P_{C,j,t}+l_{1}\right) \tag{1}\]  
where \(C_{C,j}\) is the carbon emissions of the \(j\)-th coal-fired unit, \(T\) is the total number of periods in a day, \(P_{C,j,t}\) is the generating power of the \(j\)-th coal-fired unit at the time \(t\), and \(\alpha_{1}\), \(\beta_{1}\), and \(\lambda_{1}\) are the carbon emission factors of coal-fired units. The carbon emission allowances for the coal-fired units are  
\[C_{C,j,quota}=\sum_{t=1}^{T}\lambda_{C}P_{C,j,t} \tag{2}\]  
where \(C_{C,j,quota}\) is the carbon emission quota for the \(j\)-th coal-fired unit, \(\lambda c\) is the carbon emission allowance coefficient of the coal-fired units, and \(P_{C,j,t}\) is the generating power of the \(j\)-th coal-fired unit at the time \(t\) gas turbine. The carbon emissions of gas turbines can be calculated based on the total power supply. The total power supply is equal to the sum of the electricity converted from the heat supply and the original power supply:  
\[C_{g,j}=\sum_{t=1}^{T}\lambda_{g}\left(P_{GT,j,t}+\beta H_{GT,j,t}\right) \tag{3}\]  
where \(C_{g,j}\) is the carbon emissions of the \(j\)-th gas turbine at time \(t\), \(P_{GT,j,t}\) is the power generation of gas turbine \(j\) at time \(t\), \(H_{G,j,t}\) is the output heat of gas turbine \(j\) at time \(t\), \(\lambda_{g}\) is the unit carbon emission intensity of the gas turbine, and \(\beta\) is the conversion factor of heat. Its carbon emission allowances are  
\[C_{g,j,quota}=\sum_{t=1}^{T}l_{g}\left(P_{GT,j,t}+bH_{GT,j,t}\right) \tag{4}\]  
where \(C_{g,j,quota}\) is the carbon emission allowance of gas unit \(j\), \(P_{C,j,t}\) is the power supply of gas turbine \(j\) at the time \(t\), \(\beta\) is the conversion factor of heat, \(\lambda_{g}\) is the carbon emission quota coefficient of the gas-fired units, and \(H_{G,j,t}\) is the output heat of gas turbine \(j\) at time \(t\). Gas boiler  
For gas-fired boilers, the carbon emissions are calculated based on the heating power:  
\[C_{H,j}=\sum_{t=1}^{T}\lambda_{H}f_{H,j,t} \tag{5}\]  
where \(C_{H,j}\) is the carbon emission of the \(j\)-th gas boiler, \(f_{H,j,t}\) is the gas flow of the \(j\)-th gas boiler at the time \(t\), and \(\lambda_{H}\) is the unit carbon emission intensity of gas boilers. Its carbon emission allowances are  
\[C_{H,j,quota}=\sum_{t=1}^{T}l_{fg}f_{H,j,t} \tag{6}\]  
where \(C_{H,j,quota}\) is the carbon emission quota for the \(j\)-th gas boiler, \(\lambda_{fg}\) is the carbon emission quota coefficient of the gas-fired units, and \(f_{H,j,t}\) is the gas flow of the \(j\)-th gas boiler at the time \(t\). 3. \(P2G\) equipment The carbon emissions of the \(P2G\) equipment are \[C_{P2G,j}=-\sum\limits_{t=1}^{T}l_{P2G}P_{P2G,j,t}\] (7) where \(C_{P2G,j}\) is the carbon emissions of the \(j\)-th \(P2G\) device, \(P_{P2G,j,t}\) is the input power of the \(j\)-th \(P2G\) device at the time \(t\), \(\lambda_{P2G}\) is the unit carbon emission intensity of \(P2G\) equipment. (4) New energy unit The carbon emission intensity of the wind turbines and photovoltaic units is 0, so their carbon emissions are 0, and they do not participate in carbon emissions market transactions. In summary, the free carbon emission allowance \(C_{b}\) in IES is \[C_{b}=\sum\limits_{j=1}^{l}C_{c,j,quota}+\sum\limits_{j=1}^{l}C_{Sj,j,quota}+ \sum\limits_{j=1}^{l}C_{H,j,quota}\] (8) where \(C_{c,j,quota}\) is the carbon emission quota for the \(j\)-th coal-fired unit, \(C_{g,j,quota}\) is the carbon emission allowance of gas unit \(j\), and \(C_{H,j,quota}\) is the carbon emission quota for the \(j\)-th gas boiler. The actual carbon emissions of IES are calculated by the following formula: \[