# Double-Consensus Based Distributed Optimal Energy Management for Multiple Energy Hubs
## 2 Problem Formulation
### EMP of Multiple Energy Hubs  
In this paper, we consider the EMP of interconnected energy hubs to achieve the global optimal energy configuration. Here, the anticipated structure of the multiple energy hubs system is shown in Figure 1. Compared to existing multiple energy hubs systems, it has one important difference, which is the paradigm shift from a traditional centralized manner to a distributed manner. Under this distributed structure, the work of each agent that does not rely on a centralized controller is based only on local communication and calculation to find the optimal operating point and dispatch factor. The considered EMP can be formulated as a distributed optimization problem with a global objective function and a set of constraints. 1. Objective: The total objective function is to cooperatively minimize the aggregated energy costs (i.e., the electricity and natural gas consumption costs associated with the individual energy hub) and the emissions penalty from electricity and heat power generation. The mathematical expression of this objective function can be seen in Appendix A-(b). 2. Constraints: Energy hubs collectively make decisions on their own subject to global and local constraints. Accordingly, the set of local constraints for each energy hub is listed in Appendix A-(c). Moreover, the global constraints imply the supply-demand balance constraints. Specifically, the total electricity and heat power generation, i.e., \(\sum_{i=1}^{n}E_{i,out}^{e}\) and \(\sum_{i=1}^{n}E_{i,out}^{h}\), should be equal to the total respective electricity and heat load demands, i.e., \(\sum_{i=1}^{n}l_{i}^{e}\) and \(\sum_{i=1}^{n}l_{i}^{h}\), respectively. In terms of the defined coupling matrix, we can further establish the relationship between the input variables and load demands as follows: \[\sum_{i=1}^{n}\left(\eta_{i}^{n}E_{i,in}^{e}+\eta_{i}^{e,chp}\rho_{i}E_{i,in}^{ g}\right)\ =\ \sum_{i=1}^{n}l_{i}^{e}\] (1a) \[\sum_{i=1}^{n}\left(\eta_{i}^{h,chp}\rho_{i}E_{i,in}^{g}+\eta_{i}^{ boll}(1-\rho_{i})E_{i,in}^{g}\right)\ =\ \sum_{i=1}^{n}l_{i}^{h}\] (1b)  
It is worth noting that Equations (1a) and (1b) are non-affine constraints caused by the coupled product of variables \(\rho_{i}\) and \(E_{i,in}^{g}\), which is not beneficial to the design of the distributed optimization algorithm. To address this issue, we employ the following change of variables. \[E_{i}^{g,\rho}\ =\ \rho_{i}E_{i,in}^{g},\ E_{i}^{g-\rho}\ =\ (1-\rho_{i})E_{i,in}^{g},\ E_{i,in}^{e}\ =\ E_{i}^{e} \tag{2}\]where \(E_{i}^{\mathcal{S},\rho}\) and \(E_{i}^{\mathcal{S},1-\rho}\) are the natural gas consumed by CHP unit and boiler, respectively. In this novel coordinate system, the above optimization can be re-written in the following form by some operations. \[ \begin{array}{ll}\min F&=\sum\limits_{i\ =\ 1}^{n}\ (a_{i}^{\mathcal{S}}(E_{i}^{ \mathcal{S}})^{2}+b_{i}^{\mathcal{S}}E_{i}^{\mathcal{S},1-\rho})\\ &+\sum\limits_{i\ =\ 1}^{n}\ (a_{i}^{\mathcal{S}}(E_{i}^{\mathcal{S},\rho})^{2}+ \beta_{i}^{\mathcal{S}}(E_{i}^{\mathcal{S},1-\rho})^{2}+\gamma_{i}^{\mathcal{S }}E_{i}^{\mathcal{S},\rho}E_{i}^{\mathcal{S},1-\rho}+b_{i}^{\mathcal{S}}E_{i}^ {\mathcal{S},\rho}+b_{i}^{\mathcal{S}}E_{i}^{\mathcal{S},1-\rho})\end{array}