Research on the Optimization of Energy–Carbon Co-Sharing Operation in Multiple Multi-Energy Microgrids Based on Nash Negotiation

: Efﬁcient and low-carbon energy utilization is a crucial aspect of promoting green and sustainable development. Multi-energy microgrids, which incorporate multiple interchangeable energy types, offer effective solutions for low-carbon and efﬁcient energy consumption. This study aims to investigate the sharing of energy and carbon in multiple multi-energy microgrids (MMEMs) to enhance their economic impact, low-carbon attributes, and the efﬁcient utilization of renewable energy. In this paper, an energy–carbon co-sharing operation model is established, incorporating carbon capture systems (CCSs) and two-stage power-to-gas (P2G) devices within the MMEMs to actualize low-carbon operation. Furthermore, based on cooperative game theory, this paper establishes an energy–carbon co-sharing Nash negotiation model and negotiates based on the energy–carbon contribution of each subject in the cooperation as bargaining power so as to maximize both the beneﬁts of the MMEM alliance and the distribution of the cooperation beneﬁts. The case study results show that the overall beneﬁts of the alliance can be increased through Nash negotiation. Energy–carbon co-sharing can effectively increase the renewable energy consumption rate of 8.34%, 8.78%, and 8.83% for each multi-energy microgrid, and the overall carbon emission reduction rate reaches 17.81%. Meanwhile, the distribution of the beneﬁts according to the energy–carbon co-sharing contribution capacity of each entity is fairer.


Introduction
In the context of energy transition, the development of cleaner, low-carbon energy systems lies at the heart of the contemporary energy revolution.The comprehensive utilization of energy provides an efficient solution for energy innovation and low-carbon development [1,2].Similar to integrated energy systems, multi-energy microgrids, which serve as an extension of traditional microgrids, are predicted to become the terminal energy supply systems for the Energy Internet and a key developmental trend in future energy systems [3].At present, research concerning the optimal operation of multi-energy microgrids has made some progress.Ju et al. [4] considered the uncertainty of wind and solar power generation and established a two-layer optimization model based on price and incentive demand response.To enhance the operational flexibility of microgrid energy hubs, Ma et al. [5] proposed a general modeling method for microgrid energy flow, took the minimum daily operating cost as the objective function, and established a mixed-integer linear optimization problem considering demand response.Zhang et al. [6] aimed at the operating characteristics of an island-type microgrid, introduced cooling, heating, and electric load demand response, and proposed an optimal scheduling model considering multiple types of demand responses, and the results showed that considering various demand responses can bolster the flexibility and cost-effectiveness of island microgrids.
Energies 2023, 16, 5655 2 of 20 The above research focused on the multi-energy complementarity of a single microgrid and its demand response with users, and some scholars have studied energy sharing among multiple subjects.Chiş and Koivunen [7] utilized an alliance game optimization method and distributed joint income among alliance members according to the Shapley value.To improve the economic performance of microgrid users, Liu et al. [8] proposed an energy contribution model based on price-driven demand response and designed an equivalent cost model from two aspects of economic cost and user willingness.
In terms of solution methods, the existing research on the optimal operation of microenergy networks has mostly adopted the particle swarm algorithm [9], game theory [10,11], and other approaches, and it has focused on the economic optimization operation strategy considering energy management.Maharjan et al. [12] established a Stackelberg game model for multiple suppliers and a large number of users in smart grid.Wei et al. [13] proposed a novel multi-master and multi-slave layered Stackelberg game for the analysis of multienergy transactions.Lin et al. [14] introduced an energy trading model and a solution algorithm based on the two-tier Stackelberg game for "power supply company-microgrid-user" scenarios, which considered multi-type energy transactions among multiple stakeholders in the game process and resolved conflicts between different parties.The above are studies of non-cooperative games in the optimization of microgrid energy management, where each subject in a non-cooperative game is regarded as opposite, so there is a lack of consideration for the overall interests, and the Nash equilibrium is usually locally optimal.With this in mind, Kim et al. [15] adopted the Nash negotiation method to establish a multi-microgrid power trading cooperation model and realized the distribution of multi-microgrid cooperation benefits through the resolution of the Nash product.Xu et al. [16] proposed a two-layer optimal scheduling strategy for a multi-microgrid system that considered both the demand response of energy-consuming users and the shared energy storage, introduced cooperative games in the upper layer to solve the upper optimization model, and converted the lower model into KKT optimal conditions.Wu et al. [17] further considered the optimal operation mechanism of carbon emission quota and carbon trading and established a multi-microgrid power sharing cooperative operation model based on the Nash negotiation theory.
Summarizing the literature above, the existing studies on the energy sharing of MMEMs have mostly focused on single energy sharing and have neglected carbon sharing.To further mitigate the carbon emissions of the system, this study considers carbon sharing between MMEMs in conjunction with energy sharing.To take into account the interests of individuals and alliances, the Nash negotiation method is used to construct an energy-carbon co-sharing cooperative game model.In accordance with the two fundamental principles of cooperative games, the cooperative game model is decomposed into two sub-models of the maximum alliance benefit and the income distribution, and the bargaining power of different subjects is evaluated according to the energy sharing contribution and carbon sharing contribution.To reduce the risk of privacy leakage and balance the privacy protection of different entities, both sub-models are solved by using the ADMM algorithm.
The structure of this study is as follows: Section 2 presents the structure of MMEMs, including the P2G, CHP, GB, and CCS operating models and the energy storage system model; Section 3 introduces the cost model of MMEMs; Section 4 introduces the Nash negotiation method based on cooperative games; Section 5 conducts a case study; and conclusions are drawn in Section 6.

Subsection
The MMEM operation architecture designed in this paper is shown in Figure 1.Energy is adjusted and optimized by energy conversion equipment in each multienergy microgrid (MEM) to accommodate the energy demands.In the energy-carbon sharing architecture considered in this paper, if the renewable energy output of the multienergy microgrid is surplus, it first supplies energy to other multi-energy microgrids.When its own power demand is insufficient, it purchases electricity from other multi-energy microgrids to meet its own electric energy needs and finally consider purchasing power from the grid.Since the cogeneration of heating and power (CHP) and gas boilers (GB) emit a large amount of carbon dioxide, the carbon dioxide generated during the power generation cycle enters the MEM with CCS, and the captured carbon dioxide is directed into the P2G module.

Operation Model of P2G
The P2G model in this paper includes two stages.First, an electrolyzer (EL) separates water into hydrogen and oxygen, and a methane reactor (MR) then reacts a portion of the hydrogen with carbon dioxide to generate natural gas and water, while the remaining hydrogen is utilized as fuel to produce electricity and heat energy through a hydrogen fuel cell (HFC).The P2G conversion operation model is described as follows [18]:  Energy is adjusted and optimized by energy conversion equipment in each multienergy microgrid (MEM) to accommodate the energy demands.In the energy-carbon sharing architecture considered in this paper, if the renewable energy output of the multienergy microgrid is surplus, it first supplies energy to other multi-energy microgrids.When its own power demand is insufficient, it purchases electricity from other multienergy microgrids to meet its own electric energy needs and finally consider purchasing power from the grid.
Since the cogeneration of heating and power (CHP) and gas boilers (GB) emit a large amount of carbon dioxide, the carbon dioxide generated during the power generation cycle enters the MEM with CCS, and the captured carbon dioxide is directed into the P2G module.

Operation Model of P2G
The P2G model in this paper includes two stages.First, an electrolyzer (EL) separates water into hydrogen and oxygen, and a methane reactor (MR) then reacts a portion of the hydrogen with carbon dioxide to generate natural gas and water, while the remaining hydrogen is utilized as fuel to produce electricity and heat energy through a hydrogen fuel cell (HFC).The P2G conversion operation model is described as follows [18]: where P el,H 2 i (t) is the hydrogen energy output by the EL of MEM-i at time t, P e,el i (t) is the hydrogen energy input to the EL of MEM-i at time t, η e,el is the energy conversion efficiency of the EL, P e,el i,max and P e,el i,min are the upper and lower limits of the electrical energy input to the EL of MEM-i, respectively, and ∆P e,el i,max and ∆P e,el i,min are the ramping rate constraints.
where P mr,g i (t) is the natural gas power output by the MR of MEM-i at time t, P H 2 ,mr i (t) is the hydrogen energy input to the MR of MEM-i at time t, η mr is the energy conversion efficiency of the MR, P H 2 ,mr i,max and P H 2 ,mr i,min are the upper and lower limits of the hydrogen energy input to the MR of MEM-i, respectively, and ∆P H 2 ,mr i,max and ∆P H 2 ,mr i,min are the ramping rate constraints.

•
Hydrogen fuel cells: where

Operation Model of the CHP
CHP powers the system by burning natural gas, simultaneously utilizing the generated waste heat to meet the heat load demand.The CHP operation model is as follows [18]: where is the electrical energy output by the CHP of MEM-i at time t, P

Operation Model of the CCS
The flue gas containing carbon dioxide from the power generation process enters the carbon capture device, and the carbon capture agent (e.g., sodium chloride) reacts with the carbon dioxide in the flue gas so that the carbon dioxide is adsorbed onto the carbon capture agent and then absorbed through purification treatment.The attached carbon dioxide is then used in the MR of the P2G system to synthesize natural gas for the system.The power demand of the CCS in this paper is supplied by CHP, and the CCS absorbs the carbon dioxide generated during the operation of the CHP and GB.The operating model of the CCS is as follows, and its operating power consumption is related to the amount of carbon dioxide captured [19]: where P ccs i (t) is the power consumption of the CCS of MEM-i at time t, γ ccs is the conversion coefficient of the electrical energy consumed to capture carbon dioxide, M ccs i (t) is the amount of carbon dioxide captured by the CCS of MEM-i at time t, M tre i (t) is the amount of carbon dioxide processed by the CCS, where the value does not exceed the total amount of carbon dioxide in the flue gas M c i (t), M c i (t) is the total amount of carbon dioxide in the flue gas of MEM-i at time t, M c f s ij (t) is the amount of carbon dioxide shared between MEM-i and MEM-j at time t, σ c is the carbon dioxide capture rate of the CCS, which is taken as 90%, and µ c i is the carbon emission intensity of MEM-i.

Model of Electricity and Heat Load
The electricity load in each MEM includes a fixed electricity load, a cuttable electricity load, and transferable electricity load, and the heat load includes a fixed heat load and a cuttable heat load.
where P e,load i (t) is the electricity load of MEM-i at time t, P e,trans i (t) is the transferable electricity load of MEM-i at time t, P e,cut i (t) is the cuttable electricity load of MEM-i at time t, k e,trans is the transferable proportion of the electricity load, and P e,cut i,max is the upper limit of the transferable electricity load of MEM-i.
where P h,load i (t) is the heat load of MEM-i at time t, P h,cut i (t) is the cuttable heat load of MEM-i at time t, and P h,cut i,max is the upper limit of the cuttable heat load of MEM-i.

Operation Model of Energy Storage Devices
Energy storage devices play the role of enhancing stability, and their model is as follows [20]: where E max and E min are the maximum and minimum energy storage states, respectively, E i (t) is the energy storage status of the energy storage device of MEM-i at time t, u is the energy discharge ratio of the energy storage station, which can generally be ignored, η cha and η rel are the charge and discharge efficiency, respectively, and P cha i (t) and P rel i (t) are the charge and discharge power of the energy storage device of MEM-i at time t, respectively.
The energy storage device meets the following constraints: where P cha max is the maximum value of the energy storage charge power, P rel max is the maximum value of the energy storage discharge power, and B cha t and B rel t are the charge and discharge states of the energy storage device, respectively, and are binary variables.

Objective Function
The operation goal of MMEMs is to minimize operating costs, and its objective function is as follows: where is the cost of purchasing electricity of is the energy sales income of MEM-i, C g,buy i is the cost of purchasing gas of MEM-i, C co 2 i is the carbon trading cost of MEM-i, C dr i is the cost of the demand response of MEM-i, and C c f s i is the cost of carbon sharing of MEM-i.

Cost of Buying and Selling Energy
The energy purchase and sale costs of MMEMs include electricity and gas purchasing costs and electricity sales costs, and the function is as follows: where ω grid,buy i (t), ω g,buy i (t), and ω gird,sell i (t) are the electricity purchasing price, gas purchasing price, and electricity sales price through the distribution network of MEM-i at time t, respectively, P grid,buy i (t), P g,buy i (t), and P gird,sell i (t) are the power purchasing power, gas purchasing power, and electricity sales power through the distribution network of MEM-i at time t, respectively, P f b ij (t) is the power purchased by MEM-i from MEM-j at time t, P f s ij (t) is the power sold by MEM-i to MEM-j at time t, and ω buy i (t) and ω sell i (t) are the purchasing and sales prices of MEM-i through the MEM at time t, respectively.

Cost of Demand Response
When the user side participates in a demand response, compensation needs to be given the user who transfers or cuts off the load.
[ω e,trans P e,trans i (t) + ω e,cut P e,cut i where ω e,trans , ω e,cut , and ω h,cut are the compensation unit prices for transferring the electricity load, reducing the electricity load, and reducing the heat load, respectively.

Cost of Energy Storage Devices
The economics of energy storage devices in terms of their service life can be considered as follows: where C es i is the daily investment cost of the energy storage device of MEM-i, C inv Σ is the total investment cost of the energy storage device of MEM-i, r is the depreciation rate, n is the service life of the energy storage device, and T d is the annual operating hours of the energy storage device.

Cost of Carbon Sharing
The carbon sharing process between MMEMs involves transferring the carbon dioxide generated by an MEM without a CCS to another MEM containing a CCS and allows the CCS to transmit the captured carbon dioxide to the P2G system for methane generation.The cost of carbon sharing between MMEMs is represented in the following equation: where is the amount of carbon dioxide shared between MEM-i and MEM-j at time is the price per unit of carbon that the MEM needs to pay for carbon sharing.The amount of carbon dioxide participating in the carbon trading market is related to carbon quotas, and if the main carbon dioxide emissions do not exceed the carbon quotas, the surplus can be sold for profit; otherwise, the excess amount needs to be purchased.The MEM with P2G and CCS considered in this paper has the following three carbon emission sources: purchased electricity, heat cogeneration, and gas boilers.The carbon quota model established is shown in Equation (20). where is the carbon quota of MEM-i, ς e and ς g are the carbon quota of the electricity consumption per unit of the coal-fired units and the natural gas consumption per unit of the natural gas units, respectively.
The actual carbon emissions of the system are defined as the net emissions of carbon dioxide produced by the system after accounting for the carbon dioxide sequestered by the CCS and the carbon dioxide consumed by the P2G.The carbon sharing path is illustrated in the Figure 2. means that MEM-i transmits carbon dioxide to MEM-j. () cfs ij t is the price per unit of car- bon that the MEM needs to pay for carbon sharing.

Cost of Carbon Trading
The amount of carbon dioxide participating in the carbon trading market is related to carbon quotas, and if the main carbon dioxide emissions do not exceed the carbon quotas, the surplus can be sold for profit; otherwise, the excess amount needs to be purchased.The MEM with P2G and CCS considered in this paper has the following three carbon emission sources: purchased electricity, heat cogeneration, and gas boilers.The carbon quota model established is shown in Equation (20).where is the carbon quota of MEM-i,  e and  g are the carbon quota of the elec- tricity consumption per unit of the coal-fired units and the natural gas consumption per unit of the natural gas units, respectively.The actual carbon emissions of the system are defined as the net emissions of carbon dioxide produced by the system after accounting for the carbon dioxide sequestered by the CCS and the carbon dioxide consumed by the P2G.The carbon sharing path is illustrated in the Figure 2. From Equations ( 7) and ( 8), it can be inferred that the net carbon emissions, ac i M , of the MEM include carbon dioxide emitted directly into the atmosphere through flue gas diversion and carbon dioxide indirectly emitted into the atmosphere due to the efficiency of the carbon capture system, which can be expressed by the following equation: After calculating the free carbon quota and the net carbon emission of the system using Equations ( 20) and ( 21), the carbon emission trading amount participating in the carbon market is obtained, and the model of the carbon trading cost, where  is the carbon trading cost factor.

Constraints
The MEM must meet the following electrical power balance constraints: From Equations ( 7) and ( 8), it can be inferred that the net carbon emissions, M ac i , of the MEM include carbon dioxide emitted directly into the atmosphere through flue gas diversion and carbon dioxide indirectly emitted into the atmosphere due to the efficiency of the carbon capture system, which can be expressed by the following equation: After calculating the free carbon quota and the net carbon emission of the system using Equations ( 20) and ( 21), the carbon emission trading amount participating in the carbon market is obtained, and the model of the carbon trading cost, C co 2 i , is derived as follows: where ε is the carbon trading cost factor.

Constraints
The MEM must meet the following electrical power balance constraints: where P g,load i (t) is the gas load of MEM-i at time t, and P g,buy max is the upper limit of the purchased gas power.
The MEM must meet the following heat power balance constraints: where P h,load i (t) is the heat load of MEM-i at time t.The MEM must meet the following hydrogen power balance constraints:

Nash Negotiation Method Based on Cooperative Games
The Nash negotiation optimization model used in this paper represents a cooperative game, in which the benefits of the participants can be distributed and the information between each other is fully disclosed.Different types of participants form alliances with common interests and objectives through binding agreements, with each alliance capable of reaping economic benefits.The two fundamental conditions of cooperative games are as follows: (1) for an alliance, the collective income exceeds the sum of each member's returns when operating independently; and (2) within the alliance, there should be a Paretoimproved distribution rule that ensures that each member receives more benefits than if they had not joined the alliance.
The standard model of the Nash negotiation is shown in Equation ( 27) [21]: where R x is the benefits for negotiation subject x, R x,0 is the profit before x participates in the cooperation negotiation, and N is a collection of subjects participating in the negotiation.
For the cooperation between MMEMs, Equation (28) can be obtained by applying the Nash negotiation game theory: where R i,meg,0 is the optimal operating benefit of MEM-i when there is no cooperation.
As Equation (28) represents a non-convex nonlinear optimization problem, the cooperative game model is decomposed into two sub-models [22]: Sub-model 1, i.e., the model of maximizing the benefits of the MMEM alliances, and Sub-model 2, i.e., the model of the income distribution within the alliance.

Sub-Model 1: The Model of Maximizing the Benefits of MMEM Alliances
The MMEM cooperation model derived from the Nash negotiation theory model (28) and the mean inequality is as follows: Let P j i,t represent the amount of electricity MEM-i anticipates purchasing from MEM-j and P i j,t represent the amount of electricity MEM-j anticipates selling to MEM-i.When the coupling constraint of Equation ( 30) is satisfied, it indicates that each MEM has reached a transaction consensus.
Sub-model 1 is solved using the ADMM algorithm, and the computing node only needs to transmit local variables to neighboring nodes during the iteration of the ADMM algorithm, which limits the data propagation range, reduces the risk of privacy leakage, and ensures privacy protection for each entity [23].The solution process is shown in Figure 3.
where , ,0 i meg R is the optimal operating benefit of MEM-i when there is no cooperation.
As Equation (28) represents a non-convex nonlinear optimization problem, the cooperative game model is decomposed into two sub-models [22]: Sub-model 1, i.e., the model of maximizing the benefits of the MMEM alliances, and Sub-model 2, i.e., the model of the income distribution within the alliance.

Sub-Model 1: The Model of Maximizing the Benefits of MMEM Alliances
The MMEM cooperation model derived from the Nash negotiation theory model (28) and the mean inequality is as follows: 1)-( 26) P represent the amount of electricity MEM-i anticipates purchasing from MEM-j and , i jt P represent the amount of electricity MEM-j anticipates selling to MEM-i.
When the coupling constraint of Equation ( 30) is satisfied, it indicates that each MEM has reached a transaction consensus.
1 = ,, , ( , ) Sub-model 1 is solved using the ADMM algorithm, and the computing node only needs to transmit local variables to neighboring nodes during the iteration of the ADMM algorithm, which limits the data propagation range, reduces the risk of privacy leakage, and ensures privacy protection for each entity [23].The solution process is shown in  The specific steps are as follows: 1.
Establish the augmented Lagrange function of the model (29): where λ i,j is the Lagrange multiplier, and ρ i,j = 10 −4 is a penalty parameter.

2.
For each entity, update its own electricity trading strategy through calculation.MEM-j receives the amount of electricity, P j i,t (k), which it expected to be purchased from MEM-i, and it updates its decision-making, P i j,t (k + 1).MEM-i accepts the updated decision-making information, P i j,t (k + 1), and updates its decision-making, P j i,t (k + 1); In the standard Nash negotiation model, each entity receives an equal benefit distribution in the transaction payment.However, due to information asymmetry, each subject of the MMEM possesses varying bargaining power.To further analyze and consider the environmental and economic benefits brought by energy-carbon co-sharing to the entities of each alliance, this paper employs the monotonicity of the exponential function based on the natural constant, e, to calculate the bargaining coefficient and evaluates the bargaining power of the different subjects from energy sharing and carbon sharing so as to distribute the benefits according to the energy-carbon co-sharing capacity of each entity, as shown in Equations ( 35)-(37).
where α and β are the contribution coefficients of energy sharing and carbon sharing, respectively.
After considering the bargaining coefficient, Equation (34) can be further converted into the following equation: Similar to Sub-model 1, p j i,t is the unit price of the amount of electricity that MEM-i expects to trade with MEM-j, and p i j,t is the unit price of the amount of electricity that MEMj expects to trade with MEM-i.When p j i,t = p i j,t , it indicates that there is a trading consensus between MEM-i and MEM-j.Sub-model 2 is also solved by using the ADMM algorithm with solution steps analogous to those in Sub-model 1, which will not be reiterated here.

Basic Data
Three typical MEMs were selected to analyze the energy and carbon sharing optimization results, and the diversity of the output and load among the MMEMs is shown in Figure 4. ( ) , ( ) where  and  are the contribution coefficients of energy sharing and carbon sharing, respectively.
After considering the bargaining coefficient, Equation (34) can be further converted into the following equation: p is the unit price of the amount of electricity that MEMi expects to trade with MEM-j, and , i jt p is the unit price of the amount of electricity that MEM-j expects to trade with MEM-i.When = ,, pp , it indicates that there is a trading consensus between MEM-i and MEM-j.Sub-model 2 is also solved by using the ADMM algorithm with solution steps analogous to those in Sub-model 1, which will not be reiterated here.

Basic Data
Three typical MEMs were selected to analyze the energy and carbon sharing optimization results, and the diversity of the output and load among the MMEMs is shown in Figure 4. MEM-1 and MEM-2 contained CHP units and GB units, and MEM-3 incorporated a two-stage P2G and CCS unit in addition.The purchasing price of electricity from the main grid was calculated based on time-of-use pricing: RMB 0.75/kWh from 8:00-11:00, 15:00-18:00, RMB 1.20/kWh from 12:00-14:00, 19:00-22:00, and RMB 0.40/kWh from 23:00-7:00.The selling price of electricity was RMB 0.20/kWh throughout the day, and the natural gas price was RMB 3.50/m 3 .The compensation unit price for reducing the electricity load was RMB 0.03/kWh, the compensation unit price for transferring the electricity load was RMB 0.01/kWh, and the compensation unit price for reducing the heat load was RMB 0.016/kW.The system parameters of the MMEMs are shown in Table 1 [18,22].The total investment costs of the energy storage device considered in this paper was RMB 1.3 million, with MEM-1 and MEM-2 contained CHP units and GB units, and MEM-3 incorporated a two-stage P2G and CCS unit in addition.The purchasing price of electricity from the main grid was calculated based on time-of-use pricing: RMB 0.75/kWh from 8:00-11:00, 15:00-18:00, RMB 1.20/kWh from 12:00-14:00, 19:00-22:00, and RMB 0.40/kWh from 23:00-7:00.The selling price of electricity was RMB 0.20/kWh throughout the day, and the natural gas price was RMB 3.50/m 3 .The compensation unit price for reducing the electricity load was RMB 0.03/kWh, the compensation unit price for transferring the electricity load was RMB 0.01/kWh, and the compensation unit price for reducing the heat load was RMB 0.016/kW.The system parameters of the MMEMs are shown in Table 1 [18,22].The total investment costs of the energy storage device considered in this paper was RMB 1.3 million, with annual operating hours of 8760 h, a service life of 15 years, and an annual depreciation rate of 6.3% [24].

Analysis of Energy Sharing Results
By solving Sub-model 1, the output results of each MEM could be calculated, as shown in Figure 5.The output of each MEM varied across the different time periods.The wind power output of MEM-1 was high, demonstrating a good utilization of wind energy.The photovoltaic output of MEM-2 was limited by a lack of sunlight at night, resulting in insufficient power at night.In contrast, the wind power output of MEM-3 was relatively stable, and the photovoltaic output was slightly lower compared to that of MEM-2.

Analysis of Energy Sharing Results
By solving Sub-model 1, the output results of each MEM could be calculated, as shown in Figure 5.The output of each MEM varied across the different time periods.The wind power output of MEM-1 was high, demonstrating a good utilization of wind energy.The photovoltaic output of MEM-2 was limited by a lack of sunlight at night, resulting in insufficient power at night.In contrast, the wind power output of MEM-3 was relatively stable, and the photovoltaic output was slightly lower compared to that of MEM-2.Moreover, the consumption of renewable energy had the highest priority, and each microgrid participated in the overall power coordination optimization process of the under the premise of first achieving the optimal internal power dispatch.If the power output of renewable energy could not satisfy their requirements, each MEM would adopt optimization strategies to ensure the stability of power supply.First, MEM-i would preferentially purchase electricity from MEM-j with surplus renewable energy so as to achieve complementary and the efficient use of resources.Second, after fully utilizing other renewable energy sources, MEM-i would its own energy storage devices to regulate the power load and purchase electricity from the network to meet the demand.if neither of these methods could the electricity demand, MEM-i would use gas units to supply electricity to reduce the operating costs and carbon emissions.
The energy trading results are shown in Figure 6, and the energy interactions between them were consistent with the optimization results shown in Figure 5.The data in Figure 6 show that MEM-1 had significant advantages in terms of energy sharing due to its high renewable energy output and lower load than MEM-2 and MEM-3, resulting in the highest amount of energy sharing.On the contrary, the load of MEM-3 was higher, and its excess wind power and photovoltaic power outputs were less than those of MEM-1, which led to a relatively low level of interaction during the power interaction.Nevertheless, MEM-3 could balance its electricity demand and supply by trading electrical energy with the other MEMs, thus ensuring the stable operation of the system.
MEM would adopt optimization strategies to ensure the stability of power supply.First, MEM-i would preferentially purchase electricity from MEM-j with surplus renewable energy so as to achieve complementary and the efficient use of resources.Second, after fully utilizing other renewable energy sources, MEM-i would use its own energy storage devices to regulate the power load and purchase electricity from the distribution network to meet the demand.Finally, if neither of these methods could satisfy the electricity demand, MEM-i would use gas units to supply electricity to reduce the operating costs and carbon emissions.
The energy trading results are shown in Figure 6, and the energy interactions between them were consistent with the optimization results shown in Figure 5.The data in Figure 6 show that MEM-1 had significant advantages in terms of energy sharing due to its high renewable energy output and lower load than MEM-2 and MEM-3, resulting in the highest amount of energy sharing.On the contrary, the load of MEM-3 was higher, and its excess wind power and photovoltaic power outputs were less than those of MEM-1, which led to a relatively low level of interaction during the power interaction.Nevertheless, MEM-3 could balance its electricity demand and supply by trading electrical energy with the other MEMs, thus ensuring the stable operation of the system.

Analysis of Carbon Sharing and Carbon Emission Results
The carbon dioxide power balance results are shown in Figure 7.

Analysis of Carbon Sharing and Carbon Emission Results
The carbon dioxide power balance results are shown in Figure 7.
MEM-i would preferentially purchase electricity from MEM-j with surplus renewable energy so as to achieve complementary and the efficient use of resources.Second, after fully utilizing other renewable energy sources, MEM-i would use its own energy storage devices to regulate the power load and purchase electricity from the distribution network to meet the demand.Finally, if neither of these methods could satisfy the electricity demand, MEM-i would use gas units to supply electricity to reduce the operating costs and carbon emissions.
The energy trading results are shown in Figure 6, and the energy interactions between them were consistent with the optimization results shown in Figure 5.The data in Figure 6 show that MEM-1 had significant advantages in terms of energy sharing due to its high renewable energy output and lower load than MEM-2 and MEM-3, resulting in the highest amount of energy sharing.On the contrary, the load of MEM-3 was higher, and its excess wind power and photovoltaic power outputs were less than those of MEM-1, which led to a relatively low level of interaction during the power interaction.Nevertheless, MEM-3 could balance its electricity demand and supply by trading electrical energy with the other MEMs, thus ensuring the stable operation of the system.

Analysis of Carbon Sharing and Carbon Emission Results
The carbon dioxide power balance results are shown in Figure 7.The excess carbon dioxide emissions of MEM-1 and MEM-2 initially required the purchase of carbon emission rights from the carbon trading market, but carbon sharing then transmitted them to MEM-3, which contained a CCS.This reduced the carbon trading costs of MEM-1 and MEM-2 while also reducing the overall carbon emissions of the alliance.The amount of carbon shared between the MMEMs is shown in Figure 8.
Table 2 highlights the significant changes in the carbon emissions of the MMEMs before and after participating in the cooperative game.The carbon emissions of the MMEMs were reduced to varying extents, among which the carbon emissions of MEM-1, MEM-2, and MEM-3 were reduced by 11.49%, 30.11%, and 9.10%, respectively.In addition, the overall carbon emissions of the MMEM alliance decreased by 17.81% after cooperation.This outcome indicates that the cooperative game considering carbon sharing could significantly reduce the carbon emissions and contribute to the low-carbon operation of the alliance.The excess carbon dioxide emissions of MEM-1 and MEM-2 initially required th purchase of carbon emission rights from the carbon trading market, but carbon sharin then transmitted them to MEM-3, which contained a CCS.This reduced the carbon tradin costs of MEM-1 and MEM-2 while also reducing the overall carbon emissions of the all ance.The amount of carbon shared between the MMEMs is shown in Figure 8. Table 2 highlights the significant changes in the carbon emissions of the MMEMs be fore and after participating in the cooperative game.The carbon emissions of the MMEM were reduced to varying extents, among which the carbon emissions of MEM-1, MEM-2 and MEM-3 were reduced by 11.49%, 30.11%, and 9.10%, respectively.In addition, th overall carbon emissions of the MMEM alliance decreased by 17.81% after cooperation This outcome indicates that the cooperative game considering carbon sharing could sig nificantly reduce the carbon emissions and contribute to the low-carbon operation of th alliance.As illustrated in the figure, after participating in the cooperation, the renewable energy consumption rate of MEM-1, MEM-2, and MEM-3 increased by 8.34%, 8.78%, and 8.83%, respectively.This result demonstrated that the cooperative game facilitated  As illustrated in the figure, after participating in the cooperation, the renewable energy consumption rate of MEM-1, MEM-2, and MEM-3 increased by 8.34%, 8.78%, and 8.83%, respectively.This result demonstrated that the cooperative game facilitated As illustrated in the figure, after participating in the cooperation, the renewable energy consumption rate of MEM-1, MEM-2, and MEM-3 increased by 8.34%, 8.78%, and 8.83%, respectively.This result demonstrated that the cooperative game facilitated effective electric energy sharing among the MMEMs, thereby improving the consumption rate of renewable energy.

Analysis of Renewable Energy Consumption Results
The iterative process of bargaining among the actors participating in the cooperative game is shown in Figure 12.
The proposed algorithm converged after 43 iterations with a convergence accuracy of 10 −3 , indicating that the Nash negotiation solution algorithm proposed based on ADMM exhibited a satisfactory convergence.

Analysis of Costs
Table 3 compares the operating costs of each entity before and after participating in the Nash negotiation; the income of each entity after participating in the cooperation increased, which met the basic conditions of Nash negotiation.
effective electric energy sharing among the MMEMs, thereby improving the consumption rate of renewable energy.

Analysis of Renewable Energy Consumption Results
The iterative process of bargaining among the actors participating in the cooperative game is shown in Figure 12.The proposed algorithm converged after 43 iterations with a convergence accuracy of 10 −3 , indicating that the Nash negotiation solution algorithm proposed based on ADMM exhibited a satisfactory convergence.

Analysis of Costs
Table 3 compares the operating costs of each entity before and after participating in the Nash negotiation; the income of each entity after participating in the cooperation increased, which met the basic conditions of Nash negotiation.However, due to the large differences in the installed capacity scale, the cost structure, and the benefit evaluation of various entities, it is unfair to equally distribute the internal income distribution.For example, MEM-3 had stronger carbon-emission-reduction capabilities than the other units because it contained CCS and two-stage P2G units, so the bargaining power of each entity needs to be considered.
The distribution of the benefits considering bargaining power is shown in Table 4, and when considering the bargaining coefficient based on energy-carbon co-sharing capacity, an entity with a greater bargaining power will obtain a higher benefit distribution.
MEM-1 contributed the highest amount of electricity, but it also transmitted the most carbon dioxide to MEM-3, followed by MEM-2.Although MEM-3 did not contribute a substantial amount of electricity, it received carbon dioxide from MEM-1 and MEM-2.The bargaining coefficients of MEM-1 and MEM-2 were calculated to be 0.9172 and 0.8073, respectively, and MEM-3 had the highest bargaining coefficient of 1.2533, so MEM-3 could be allocated the largest yield.Comparing the results in Tables 3 and 4, it becomes evident that after considering the bargaining coefficient based on energy-carbon co-sharing capacity, MEM-3 with a CCS and a two-stage P2G could obtain higher returns than before, where the income value increased from RMB 3609.61 to RMB 12,047.This shows that the bargaining coefficient method based on energy-carbon co-sharing capacity is helpful in mobilizing the enthusiasm of all subjects to actively participate in the cooperative game.
Figure 13 shows the electricity transaction price of each MEM after considering the bargaining coefficient of the energy-carbon co-sharing capability.It is apparent that the trading price of electricity between the MMEMs was lower than the purchasing price of electricity from the distribution network and higher than the price of selling electricity to the distribution network.As a result, each MEM preferred to sell electricity at a higher price than the price sold to the distribution network and purchase electricity at a lower price than the purchasing price from the distribution network.
pacity, an entity with a greater bargaining power will obtain a higher benefit distribution.MEM-1 contributed the highest amount of electricity, but it also transmitted the most carbon dioxide to MEM-3, followed by MEM-2.Although MEM-3 did not contribute a substantial amount of electricity, it received carbon dioxide from MEM-1 and MEM-2.The bargaining coefficients of MEM-1 and MEM-2 were calculated to be 0.9172 and 0.8073, respectively, and MEM-3 had the highest bargaining coefficient of 1.2533, so MEM-3 could be allocated the largest yield.
Comparing the results in Tables 3 and 4, it becomes evident that after considering the bargaining coefficient based on energy-carbon co-sharing capacity, MEM-3 with a CCS and a two-stage P2G could obtain higher returns than before, where the income value increased from RMB 3609.61 to RMB 12,047.This shows that the bargaining coefficient method based on energy-carbon co-sharing capacity is helpful in mobilizing the enthusiasm of all subjects to actively participate in the cooperative game.
Figure 13 shows the electricity transaction price of each MEM after considering the bargaining coefficient of the energy-carbon co-sharing capability.It is apparent that the trading price of electricity between the MMEMs was lower than the purchasing price of electricity from the distribution network and higher than the price of selling electricity to the distribution network.As a result, each MEM preferred to sell electricity at a higher price than the price sold to the distribution network and purchase electricity at a lower price than the purchasing price from the distribution network.

Conclusions
Based on the Nash game theory, this paper studied the energy-carbon co-sharing optimization of MMEMs.An energy-carbon co-sharing operation model of MMEMs was established, and the model was decomposed into two sub-models, namely one that considered the maximization of benefits of an MEM alliance and another that considered the distribution of the cooperative income.The energy-carbon co-sharing contribution capacity of each participant was considered in the distribution of the cooperative income sub model.The primary conclusions are as follows: • Energy-carbon co-sharing among MMEMs facilitates the complementary and efficient utilization of resources.Through the cooperative games, the renewable energy consumption was enhanced, resulting in increased renewable energy consumption rates of 8.34%, 8.78%, and 8.83% for MEM-1, MEM-2, and MEM-3, respectively.

•
Energy-carbon co-sharing among MMEMs based on cooperative games can reduce the overall carbon emissions of MMEM alliances.The carbon emissions of each MEM in the case study were reduced to varying degrees, and the overall carbon emission reduction rate reached 17.81%, which proves that the energy-carbon co-sharing of MMEMs based on the Nash game is effective in reducing carbon emissions.

•
The Nash-negotiation-solving algorithm of the MMEM alliance based on ADMM had good convergence, and the convergence accuracy reached 10 −3 while also considering the privacy protection of each subject.

•
The bargaining coefficient method based on energy-carbon co-sharing capacity is helpful in mobilizing the enthusiasm of all subjects to actively participate in the cooperative game.MEMs containing low-carbon units such as CCS and two-stage P2G units can achieve a fairer distribution of benefits compared to scenarios in which bargaining factors are not considered.Microgrids with higher renewable energy generation and more carbon capture can also obtain higher benefits in the energy-carbon co-sharing process.
In the future, further research can be conducted on games with various energy sources and explore more accurate and fair methods of benefit allocation.In addition, the refined modeling and capacity optimization configuration of carbon capture systems in microgrids can also be studied to minimize carbon emissions.

5 .
Cost of Carbon Trading

Figure 2 .
Figure 2. Diagram of carbon sharing path.

Figure 2 .
Figure 2. Diagram of carbon sharing path.

Figures 9 -
Figures 9-11 compare the renewable energy consumption before and after the partic ipation of the MMEMs in the cooperative game.

Figure 9 .
Figure 9.Comparison of renewable energy consumption in MEM-1 before and after the Nash negotiations: (a) before the Nash negotiations; (b) after the Nash negotiations.

Figure 9 .
Figure 9.Comparison of renewable energy consumption in MEM-1 before and after the Nash negotiations: (a) before the Nash negotiations; (b) after the Nash negotiations.

Figure 9 .Figure 10 .Figure 11 .
Figure 9.Comparison of renewable energy consumption in MEM-1 before and after the Nash negotiations: (a) before the Nash negotiations; (b) after the Nash negotiations.

Figure 10 .
Figure 10.Comparison of renewable energy consumption in MEM-2 before and after the Nash negotiations: (a) before the Nash negotiations; (b) after the Nash negotiations.

Figure 9 .Figure 10 .Figure 11 .
Figure 9.Comparison of renewable energy consumption in MEM-1 before and after the Nash negotiations: (a) before the Nash negotiations; (b) after the Nash negotiations.

Figure 11 .
Figure 11.Comparison of renewable energy consumption in MEM-3 before and after the Nash negotiations: (a) before the Nash negotiations; (b) after the Nash negotiations.
) is the electrical energy output by the HFC of MEM-i at time t, P ] After completing a round of iterations, update the Lagrange multiplier and update the iteration number, k = k + 1:λ i,j (k + 1) = λ i,j (k) + ρ i,j ( P ,of the MMEMs, which can be substituted into Sub-model 2 to construct an internal revenue allocation model for the MMEM alliance based on the Nash negotiation model.Quantities marked with a superscript * are the obtained values, as shown in Equation (34).

Table 1 .
Parameters of model.

Table 1 .
Parameters of model.

Table 2 .
Comparison of carbon emission results.

Table 2 .
Comparison of carbon emission results.11 compare the renewable energy consumption before and after the participation of the MMEMs in the cooperative game.

Table 3 .
Comparison of operating costs before and after participation in Nash negotiations.

Table 3 .
Comparison of operating costs before and after participation in Nash negotiations.
* The exchange rate of RMB to USD on 17 July 2023 was 1 RMB = 0.1385 USD.

Table 4 .
Distribution of benefits based on bargaining power.

Table 4 .
Distribution of benefits based on bargaining power.