## 3 Distributed Method
### Distributed Method  
Inspired by the consensus algorithm, this paper focuses on combing the consensus algorithm and the optimization theory to design a suitable, distributed method to solve the CHPEDP. Therein, there exist strong power-heat-coupling features both in the objective function and constraint limits. To address this issue, from the analysis in Section 2.3, there is not only an optimal electrical incremental cost \(\lambda_{p}^{*}\) but also an optimal heat incremental cost \(\lambda_{q}^{*}\). More importantly, \(\lambda_{p}^{*}\) and \(\lambda_{q}^{*}\) are global variables. However, there is no centralized controller in this paper. Thus, the basic concept is to establish two different consensus protocols, in which the one is to make the electrical incremental cost run an common value (i.e., the final consensus value) and the other is to make heat incremental cost run an another common value, meanwhile a feedback mechanism is designed and added into the corresponding consensus protocol to obtain the optimal \(\lambda_{p}^{*}\) and \(\lambda_{q}^{*}\). In addition, to solve the electrical-heating-coupling problem, which has been illustrated in Remark 1, the basic idea is to establish an effective alternating iterative method to solve this problem, where electricity and heat alternately converge to the optimal solution. Then, the updating rules of the proposed distributed method are designed as:(1) In the even-numbered iteration  
\[\left\{ \begin{array}{l}\lambda_{i}^{p}(2k)=\lambda_{i}^{p}(2k-1),\quad\lambda_{i }^{pq}(2k)=\lambda_{i}^{pq}(2k-1)\\ \lambda_{i}^{qp}(2k)=\sum\limits_{j\in\mathbb{N}_{i}^{in}}\bar{\tau}_{i,j} \lambda_{i}^{q}(2k-1)+\eta\gamma_{i}^{qp}(2k-1),\quad\lambda_{i}^{q}(2k)=\sum \limits_{j\in\mathbb{N}_{i}^{in}}\bar{\tau}_{i,j}\lambda_{i}^{q}(2k-1)+\eta \gamma_{i}^{q}(2k-1)\end{array} \right. \tag{11a}\]  
\[\left\{ \begin{array}{l}z_{i}^{p}(2k)=x_{i}^{p}(2k-1),\quad z_{i}^{pq}(2k)=x_{ i}^{pq}(2k-1)\\ z_{i}^{qp}(2k)=(\lambda_{i}^{qp}(2k)-\beta_{i}-\xi_{i}x_{i}^{pq}(2k-1))/2\alpha _{i},\quad z_{i}^{q}(2k)=(\lambda_{i}^{q}(2k)-\beta_{i})/2\alpha_{i}\\ \end{array} \right. \tag{11b}\]  
\[\left\{ \begin{array}{l}x_{i}^{p}(2k)=z_{i}^{p}(2k),\quad x_{i}^{pq}(2k)=z_{ i}^{pq}(2k)\\ z_{i,\min}^{qp}(2k)<z_{i,\min}^{qp}(2k)(z_{i}^{pq}(2k))\\ z_{i,\max}^{qp}(2k)(z_{i}^{pq}(2k))\\ ifz_{i}^{qp}(2k)>z_{i,\max}^{qp}(2k)(z_{i}^{pq}(2k))\\ z_{i}^{qp}(2k)\text{ otherwise}\end{array} \right.,\quad x_{i}^{q}(2k)=\left\{ \begin{array}{l}x_{i,\min}^{q}\,if\,z_{i}^{q}(2k)<x_{i,\min}^{q}\\ x_{i,\max}^{q}\,if\,z_{i}^{q}(2k)>x_{i,\max}^{q}\\ z_{i}^{q}(2k)\text{ otherwise}\end{array} \right. \tag{11c}\]  
\[\left\{ \begin{array}{l}y_{i}^{p}(2k)=y_{i}^{p}(2k-1),\quad y_{i}^{pq}(2k)=y _{i}^{pq}(2k-1)\\ y_{i}^{qp}(2k)=\sum\limits_{j\in\mathbb{N}^{in}}\bar{\tau}_{i,j}y_{i}^{q}(2k-1 )-x_{i}^{qp}(2k)+x_{i}^{qp}(2k-1)\\ y_{i}^{q}(2k)=\sum\limits_{j\in\mathbb{N}_{i}^{in}}\bar{\tau}_{i,j}y_{i}^{q}(2k -1)-x_{i}^{q}(2k)+x_{i}^{q}(2k-1)\end{array} \right. \tag{11d}\]  
(2) In the odd-numbered iteration  
\[\left\{ \begin{array}{l}\lambda_{i}^{p}(2k+1)=\sum\limits_{j\in\mathbb{N}_{i }^{in}}r_{i,j}\lambda_{j}^{\Theta}(2k)+\eta\
u_{i}^{p}(2k),\quad\lambda_{i}^{pq }(2k+1)=\sum\limits_{j\in\mathbb{N}_{i}^{in}}r_{i,j}\lambda_{j}^{\Theta}(2k)+ \eta\
u_{i}^{pq}(2k)\\ \lambda_{i}^{qp}(2k+1)=\lambda_{i}^{qp}(2k),\quad\lambda_{i}^{q}(2k+1)=\lambda _{i}^{q}(2k)\end{array} \right. \tag{12a}\]  
\[\left\{ \begin{array}{l}z_{i}^{p}(2k+1)=(\lambda_{i}^{p}(2k+1)-b_{i})/2a_{i}, \quad z_{i}^{pq}(2k+1)=(\lambda_{i}^{pq}(2k+1)-b_{i}-\xi_{i}x_{i}^{qp}(2k))/2a _{i}\\ z_{i}^{qp}(2k+1)=x_{i}^{qp}(2k),\quad z_{i}^{q}(2k+1)=x_{i}^{q}(2k)\end{array} \right. \tag{12b}\]  
\[\left\{ \begin{array}{l}x_{i}^{p}(2k+1)=\left\{\begin{array}{l}x_{i,\min}^{ p}\,if\,z_{i}^{p}(2k+1)<x_{i,\min}^{p}\\ x_{i,\max}^{p}\,if\,z_{i}^{p}(2k+1)>x_{i,\max}^{p}\\ z_{i,\max}^{q}\,if\,z_{i}^{p}(2k+1)>x_{i,\max}^{q}\\ z_{i,\max}^{pq}(2k+1)(z_{i}^{qp}(2k+1))\\ z_{i}^{pq}(2k+1)\,\text{otherwise}\end{array}\right.\end{array} \right.