# Distributed Energy Sharing for PVT-HP Prosumers in Community Energy Internet: A Consensus Approach
## 5 Problem Formulation and Algorithm
### Design of Algorithm
The iterative optimization processes of incremental cost (incremental utility) \(\mu_{i}\), the local power of each participator \(H_{i}\) and the local thermal power mismatch \(\xi_{i}^{H}\) at 1:00 are shown in Figure 3. As shown in Figure 3, the incremental cost (incremental utility) converges to its final value \(\mu^{*}=\) 0.2701 CNY/kWh with iterations, while all the local thermal power mismatch \(\xi_{i}^{H}\) approach to 0.0098 as shown in Figure 3. Moreover, from Figure 3, the results show that the output power of CHP is 0 kW at the beginning and then gradually approaches to the convergence value \(H_{i}^{*}=\) 17.01 kW. The net thermal power of prosumer 1 and prosumer 2 are negative which means that they share excess thermal energy with other prosumers. More importantly, all the prosumers and CHP operator achieve the same incremental \begin{table}
\begin{tabular}{c c c} \hline \hline
**Participant** & **Parameters** & **Value** \\ \hline \multirow{2}{*}{Utility grid} & Cost coefficients & \(a=0.00059\), \(b=0.302\), \(c=0\) \\ \cline{2-3}  & Capacity & \([-500,1000]\) (kW) \\ \hline \multirow{4}{*}{CHP} & Cost coefficients & \(\phi=0.03395\), \(\beta=4.6425\), \(\gamma=0.00442\) \\ \cline{2-3}  & & \(\delta=1.345\), \(\theta=0.00384\), \(\varphi=0.004\) \\ \cline{2-3}  & Efficiency & \(\eta_{e}=0.3441\), \(\eta_{r}=0.80\) \\ \cline{2-3}  & Capacity & 50 (kW) \\ \hline \multirow{4}{*}{PVT-HP prosumer} & COP & 3 \\ \cline{2-3}  & Coefficients of comfort & \(v_{i}\in\)(0.03–0.055), \(\omega_{i}\in\) (0.025–0.1) \\ \cline{1-1} \cline{2-3}  & Capacity of heat pump & 15 (kW) \\ \hline \end{tabular}
\end{table} 
Table 1: Parameters of participants. cost (incremental utility), under which all the participants achieve their own goal, i.e., maximize the individual welfare. Figure 2: Daily load curves of prosumers: (**a**) daily electric load curves; (**b**) daily thermal load curves; (**c**) daily electric net power curves. Figure 4 shows the convergence results of electric network. In Figure 4a,b, all the participants convergence to the same incremental cost (utility), i.e., \(\lambda_{i}^{*}\) = 0.740 CNY/kWh, while the local power mismatch get close to 0.0027. Moreover, Figure 4c shows that the variation tendency of CHP is the same as the results in Figure 3c. In this time slot, there is no solar energy, the prosumers has to buy 373.46 kWh from the utility grid to meet the electric demand of load and heat pump. The total social welfare of the CEI approaches to its convergence result at 1555.0 CNY, as shown in Figure 5.

Figure 3: Convergence results of thermal network: (**a**) incremental cost (utility); (**b**) local thermal power mismatch; (**c**) local generated or consumed thermal power. Figure 4: Convergence results of electric network: (**a**) incremental cost (utility); (**b**) local electric power mismatch; (**c**) local generated and consumed electric power. Figure 5: Convergence results of total social welfare. #### 6.2.2 Results of Price and Net Power

By using the basic data of six prosumers, CHP and utility grid, consensus-based energy sharing of the CEI on each time slot of a day can be solved by executing Algorithm 1. The price of electric power and thermal power during the daytime are shown in Figure 6. From 0:00 to 8:00 and 20:00 to 24:00, the electric price is high because there is no solar energy and the end users have to purchase energy from the utility grid. The electric price changes with the variety of PV output from 8:00 to 20:00 and gets its minimal value 0.1973 CYN/kWh at 14:00. After 20:00, the electric price increases for the reason that there is a peak electric load from 19:00 to 22:00. The variation tendency of the thermal price is consistent with the thermal load curve. At night, the higher thermal load level leads to the higher prices, i.e., 0.25-0.3 CNY/kWh. The thermal price decreases with the thermal load reduction and increases gradually with the increasing demand during the day.