# Energy Trading Strategy for Heat and Electricity-Coupled Microgrid Based on Cooperative Game
## 6 Distribution Solution
### Algorithm Implementation
\[\frac{1}{U_{g}+\sum\limits_{i}^{n}\sum\limits_{h=1}^{H}U^{h}_{si}-C_{gss}-B_{ MGO}}-\frac{1}{\sum\limits_{h=1}^{H}\left[k^{h}_{i}\ln(1+el^{h}_{i})-U^{h}_{si}- \alpha_{i}\Delta ht^{2}_{i}\right]-B_{i}}=0 \tag{13}\]

Formula (A3) can be further transformed into:

\[U_{g}+\sum\limits_{i=1}^{N}\sum\limits_{h=1}^{H}U^{h}_{si}-C_{gss}-B_{MGO}= \sum\limits_{h=1}^{H}\left[k^{h}_{i}\ln(1+el^{h}_{i})-U^{h}_{si}-\alpha_{i} \Delta ht^{2}_{i}\right]-B_{i} \tag{14}\]

Sum \(i\) on both sides of the Equation (A4)

\[n(U_{g}+\sum\limits_{i=1}^{N}\sum\limits_{h=1}^{H}U^{h}_{si}-C_{gss}-B_{MGO}) =\sum\limits_{i=1}^{n}\left\{\sum\limits_{h=1}^{H}\left[k^{h}_{i}\ln(1+el^{h }_{i})-U^{h}_{si}-\alpha_{i}\Delta ht^{2}_{i}\right]-B_{i}\right\} \tag{15}\]

Therefore,

\[\sum\limits_{i=1}^{N}\sum\limits_{h=1}^{H}U^{h}_{si}=\frac{\sum\limits_{i=1} ^{n}\left\{\sum\limits_{h=1}^{H}\left[k^{h}_{i}\ln(1+el^{h}_{i})-\alpha_{i} \Delta ht^{2}_{i}\right]-B_{i}\right\}-nC_{gss}-nB_{MGO}-nU_{g}}{(n+1)} \tag{16}\]

By Substituting Formula (A6) into Formula (A4), It can be obtained that

\[\sum\limits_{h=1}^{H}U^{h}_{si}=\sum\limits_{h=1}^{H}\left[k^{h}_{i}\ln(1+el^ {h}_{i})-\alpha_{i}\Delta ht^{2}_{i}\right]-B_{i}-\frac{\sum\limits_{i=1}^{N }\left\{\sum\limits_{h=1}^{H}\left[k^{h}_{i}\ln(1+el^{h}_{i})-\alpha_{i}\Delta ht ^{2}_{i}\right]-B_{i}\right\}+(U_{g}-C_{gss})-B_{MGO}}{n+1} \tag{17}\]

By substituting Formula (A6) and (A7) into (A2), the objective function (A2) can be reformulated as

Figure 9:0

The objective function (A8) can be equivalent to:

Figure 9:1

The objective function (A9) is composed of the transaction income of the power grid, the cost of natural gas, the benefit created by users through energy consumption, and the environmental dissatisfaction cost of users. Obviously, the essence of the objective function (A9) is the problem of maximizing social welfare. Therefore, the NBS of bargaining problem (26) is also the solution to the social welfare maximum problem. ## Appendix B

The first derivative of problem (6) with respect to \(el_{i}^{h}\) is calculated as:

Figure 9:2

By setting the right of (10) to zero, the optimal value of \(el_{i}^{h}\) can be solved as:

Figure 9:3

It is assumed that the original electric load \(el_{i}^{ho}\) is the optimal value of electric energy consumption under the grid selling price \(p_{gs}^{h}\). Thus, parameter \(k_{i}^{h}\) can be calculated as:

Figure 9:4

## References

* [1] [PERSON]; [PERSON] [PERSON]; [PERSON]; [PERSON] Smart technologies for promotion of energy efficiency, utilization of sustainable resources and waste management. _J. Clean. Prod._**2019**, _231_, 565-591. [CrossRef]
* [2] [PERSON]; [PERSON]; [PERSON] Impact of Strategic Deployment of CHP-Based DERs on Microgrid Reliability. _IEEE Trans. Power Deliv._**2010**, _25_, 1697-1705. [CrossRef]
* [3] [PERSON]; [PERSON]; [PERSON] A method of selecting cold and heat sources for enterprises in an industrial park with combined cooling, heating, and power. _J. Clean. Prod._**2018**, _190_, 608-617. [CrossRef]
* [4] [PERSON]; [PERSON]; [PERSON]; [PERSON] Day-ahead scheduling and real-time Economic MPC of CHP unit in Microgrid with Smart buildings. _IEEE Trans. Smart Grid_**2017**, _10_, 1992-2001. [CrossRef]
* [5] [PERSON]; [PERSON]; [PERSON] Rollout strategies for real-time multi-energy scheduling in microgrid with storage system. _IET Gener. Transm. Distrib._**2015**, _10_, 688-696. [CrossRef]
* [6] [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Operational Flexibility Constrained Intraday Rolling Dispatch Strategy for CHP Microgrid. _IEEE Access_**2019**, \(7\), 96639-96649. [CrossRef]
* [7] [PERSON] Generation Applications Package for Combined Heat Power in On-Grid and Off-Grid Microgrid Energy Management System. _IEEE Access_**2016**, \(4\), 3444-3453. [CrossRef]
* [8] [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Modeling Combined Heat and Power Systems for Microgrid Applications. _IEEE Trans. Smart Grid_**2017**, \(9\), 4172-4180.