Abstract

The high level of integration of distributed generation systems (DGSs), especially distributed wind and solar, significantly affects the flexibility and controllability of the power system. Aggregating local DGSs and shared energy storage systems (ESSs) within an energy community offers an economically and environmentally viable solution. However, the coupling of shared ESSs with the energy community, while considering subjectivity, is often overlooked. Therefore, this study introduces a two-layer optimization framework that enables DGSs to trade energy freely, voluntarily, and independently and to share ESSs within the energy community, considering participants’ subjectivity. The upper layer optimizes the size of shared ESSs, while the lower layer, structured as a two-layer model, simulates participant interactions. The numerical case shows that, compared to DGSs operating individually, the shared ESS case indicates that community self-sufficiency and self-consumption rates increase by 16.22% and 21.98%, respectively. Additionally, the annual operating cost is reduced by approximately 27.10%, and CO2 emissions are decreased by about 33.24%. Considering DGS’ subjectivity, the self-sufficiency and self-consumption rates are 3.04% lower, and the total operating costs and CO2 emissions are 3.26% and 6.86% higher, respectively.

1. Introduction

As the pressure to reduce CO2 emissions intensifies, distributed generation systems (DGSs) capable of effectively integrating and utilizing local renewable resources have garnered widespread attention [1]. However, the high level of integration of uncertain and variable DGS will lead to frequent load-generation imbalances in the power system due to a lack of flexibility [2]. Energy storage systems (ESSs) provide an effective source of flexibility. Therefore, ESSs have become a standard requirement for new energy projects in China to be connected to the public grid. According to research data from the China Electricity Council, by the end of 2022, nearly 30 provinces had issued the “14th Five-Year Plan” for new ESS planning or new energy allocation ESS documents. However, the equivalent utilization coefficient for new energy allocation ESSs is only 6.1%, and the equivalent utilization coefficient for user ESSs is only 28.3% [3]. This indicates limited flexibility in the current deployment of ESSs for renewable energy sources. Therefore, there is a need to explore more effective ways to enhance the flexibility of DGSs.

Integrating the energy community in addition to installing ESSs is another way to increase system flexibility. However, due to their inherent characteristics and economic challenges, neither method can fully maintain the supply and demand balance of DGSs [47]. ESSs can bridge the time imbalance between renewable energy generation and demand by transferring power across different periods, thus enhancing the system’s flexibility in the temporal dimension. However, the high upfront investment for ESSs is difficult to recover, becoming an obstacle to improving DGS flexibility using ESSs [810].

Furthermore, an energy community consisting of multiple geographically adjacent DGSs connected by electrical and communication networks can share resources, thereby improving system flexibility in the spatial dimensions [11]. It provides DGSs with a market platform for local power generation trading according to the energy trading rules within the energy community, promoting energy exchange between DGSs [12] to balance supply and demand within the energy community in the spatial dimension. However, the energy community cannot balance the supply and demand in the temporal dimension. The combination of an ESS and energy community, that is, sharing of the ESS and energy within the energy community, not only compensates for the flexibility of DGS in both temporal and spatial dimensions but also reduces the investment pressure of the ESS by distributing its cost and increases the revenue of ESS through community transactions. Therefore, combining an ESS and an energy community is a strategy worth exploring to improve flexibility.

Although several studies have explored the integration of ESS with energy communities, most overlook the crucial interplay between ESS sizing and energy community operations, along with the subjectivity of community participants [1315]. On the one hand, the size of the shared ESS influences the community operation strategy, while the complexity of community operation impacts the sizing planning of the shared ESS. On the other hand, as an independent entity, the DGS participating in the energy community should have the freedom to choose trading partners, voluntarily join the energy community, independently agree on the trading right, and maintain privacy; that is, there should be a limited information exchange. Thus, the subjectivity of DGSs as independent entities is reflected in four aspects: (1) freely selecting trading partners, energy community, or public grid; (2) independently determining the trading volume with trading partners; (3) voluntary, rather than mandatorily participating in community transactions; and (4) providing limited information at the time of the transaction. A comprehensive theoretical framework is required, and this has never been realized. Therefore, it is necessary to develop a two-layer optimization framework for shared ESS capacity and community operation that considers the subjectivity of participants [1619].

Establishing the two-layer optimization framework required addressing three key questions: how to couple ESS sizing with community operation optimization, guarantee participant autonomy in community transactions, and protect participant privacy during these transactions. The contributions of this study are as follows: (i)Establishing a two-layer framework for ESS sizing and community operation optimization(ii)Designing an energy community structure that enables free choice of trading partners(iii)Decomposing the optimization model to ensure transaction rights and privacy protection(iv)Assessing technical, economic, and environmental performance to guide ESS sharing within energy communities

The remainder of this paper is organized as follows. Section 2 summarizes the literature review related to intracommunity interactions and ESS planning. Section 3 introduces the proposed two-layer nested model and presents the solution. Section 4 presents the case study and discusses the results. Section 5 concludes the paper and provides recommendations for future research.

2. Literature Review

The flexibility of distributed generation systems has garnered extensive attention due to the increasing popularity of renewable energy generation. ESSs and energy communities are typical means of balancing system supply and demand to improve system flexibility and have been extensively studied [47]. Research on ESSs is focused on both private and shared ESSs. Studies related to private ESSs often concentrate on their application [2022], frequently overlooking the initial investment that is difficult to recover [810]. Most research on shared ESSs is devoted to demonstrating their various performance advantages, with little attention being paid to optimizing their size. Research on the energy community focuses on modelling the community structure, yet the challenge of ensuring the overall economy while accommodating participants’ subjectivity as an individual has not been fully addressed [1619]. Additionally, few researchers have explored the coupling between ESSs and the energy community and a coupling model that considers participants’ subjectivity has never been implemented [1315].

Research related to ESSs focuses on size optimization and economic scheduling but often neglects strategies to mitigate ESS costs. He et al. [20] analyzed the impact of ESS capacity on levelized energy cost and renewable energy penetration. Nguyen et al. [21] proposed a multiobjective optimization model for a system that includes an ESS, aiming to find a reasonable balance between capital investment and system reliability to meet dynamic energy demand. Wang et al. [22] optimized the size of typical independent energy systems, including ESSs, with the goals of minimizing annual system costs, reducing power supply probability losses, and cutting greenhouse gas emissions. Li et al. [23] introduced a model predictive control-based energy management strategy that combines self-trending prediction with the subset-searching algorithm to enhance battery efficiency and reduce operating costs. These studies primarily focus on the overall optimization of single DGSs, employing single-objective or multiobjective methods to optimize the capacity and scheduling of various devices with ESSs according to specific scenarios’ needs. However, many researchers have acknowledged that the initial costs of ESSs are challenging to recover due to their high price, which limits the adoption of ESSs [810].

Recent studies have highlighted the effectiveness of shared ESSs in reducing electricity bills, peak power, and CO2 emissions and increasing renewable energy consumption. Consequently, shared ESSs have emerged as a viable alternative for reducing costs and enhancing local energy consumption [24]. Most research optimizes community operations assuming a predetermined shared ESS capacity. The typical approach involves optimizing the capacity of each DGS’s private ESSs and then assuming that the shared ESS capacity equals the total capacity of all private ESSs. Walker and Kwon [7] assumed that the total capacity of shared and private ESSs was identical and analyzed the actual benefits of residential shared ESS compared to private ESSs can lower costs and improve ESS utilization. Dhundhara et al. [24] evaluated the technical, economic, and environmental benefits of a shared ESS based on these assumptions, showing increased benefits for the energy community and DGSs with a shared ESS. Pimm et al. [25] introduced an ESS dispatch optimization framework using linear programming and model predictive control to examine the effects of community-shared ESSs on economic and environmental performance, as well as utility grids. Walker and Kwon [26] developed an efficient shared ESS control strategy that enables a single user to make operational decisions for economically viable energy sharing. Dong et al. [27] studied the impact of geographic location on shared ESS benefits by considering the scale of private and shared ESSs. Dong et al. [28] investigated the influence of electricity pricing models and ESS scheduling strategies on system performance under a fixed shared ESS scale. Li et al. [29] proposed an ESS-sharing framework with a defined capacity, considering hydrogen trading. Terlouw et al. [30] examined two scenarios of shared ESS ownership and analyzed the impact of different ESS types on the economic and environmental performance of the system. These studies, all based on a predetermined shared ESS capacity, highlight that empirical methods for configuring shared ESSs often result in capacities that are either too large or too small, leading to unreliable performance evaluation results.

Limited information interaction necessitates communication. Communication modes include decentralized and centralized communication. Common forms of decentralized communication are peer-to-peer (P2P) networks and multiagent systems (MASs). Decentralized communication lacks a central control system, is not prone to total collapse due to a single system failure, and can be flexibly extended. However, the absence of centralized control may lead to data inconsistency and synchronization problems, making it more challenging to achieve a global consistency policy. Additionally, to reach a consensus or synchronize information, a large number of communication exchanges between systems may be required, increasing the communication overhead [31]. Samuel and Javaid [32] proposed a blockchain system to address the issue of consumer anonymity during smart grid energy transactions. Touma et al. [33] discussed the advantages of MAS control solutions. Liu [34] introduced blockchain technology into the energy system to create an energy blockchain network, which helps solve problems such as information security. Zhang et al. [35] proposed a user payment privacy protection scheme based on linkable ring signatures for P2P uniform-price dual auction transactions in the microgrid day-ahead market, ensuring the untraceability of transaction payments with producer and consumer anonymity. Hussain et al. [36] introduced an effective communication method that optimizes power transactions while maximizing collective welfare without relying on a central hub or authority. Although decentralized communication can support the subjectivity of DGS, it significantly increases communication costs and is economically inefficient [37].

In centralized communications, the central system handles all information exchanges, data aggregation, and coordination. Centralized processing aids in achieving efficient resource allocation and optimized decision-making and ensures the consistency of the system state, which facilitates the implementation of global policies and monitoring. The DGSs in an energy community operate independently and simultaneously, interacting with the upper-level energy community within the same hierarchical framework, which then coordinates transactions between DGSs. A two-layer model has been used to represent the energy transactions between the energy community and the DGSs. Köbrich et al. [38] proposed a collaborative robust distributed hierarchical energy management system for multiple microgrids based on robust distributed model predictive control. Karimi et al. [16] proposed a leader-multifollower optimization method for energy trading in a multi-DGS system. The upper layer was modelled as a multiobjective optimization model, with objectives such as the profits of the distribution grid operator, independence, and energy not provided by the system. At the lower level, DGSs were considered followers aiming to minimize their costs. However, a DGS can only trade with the distribution network and cannot freely choose the trading partner. The transaction price determined by the distribution network can easily cause trust problems. Tomin et al. [17] established an internal local market for the energy community based on two-layer planning and reinforcement learning to exchange energy and services. Lower-level issues clear the market, while upper-layer issues serve the role of energy community operators (ECOs). The model focuses on the mutual independence and influence of planning and operation. Wu et al. [19] proposed a two-layer transaction model that included DGSs and shared ESSs. The lower layer determined the power configurations, and the upper layer calibrated the sharing scheme. Yuan et al. [39] proposed a two-tier planning model to coordinate the master-slave hierarchy in the electricity market. At the upper level, the master grid determines tariffs and generation for the maximum profit of suppliers, while multiple microgrids operating in islanded or grid-connected mode are considered at the lower level. However, the platform calculates and distributes the player’s revenue, which can also lead to trust issues. The above research acknowledges that only limited information is exchanged during the transaction process but overlooks the subjectivity of DGSs, that is, DGSs freely, voluntarily, and independently participating in community interaction.

A few researchers have explored the coupling method between the ESS size and community operation. Hafiz et al. [13] proposed a multistage stochastic programming approach for sizing ESSs and provided an energy management framework for an energy community comprising multiple dwellings and distributed solar generation. The proposed model ensures the independence of the shared ESS and the energy community. Liu et al. [14] introduced a shared ESS planning method based on cost-benefit analysis to minimize the electricity purchase cost for retailers. Li et al. [15] developed a genetic algorithm to determine the optimal size and number of shared ESSs and discussed the benefits of shared ESSs. These studies have utilized optimization methods to determine the capacity of shared ESSs and offered optimal strategies for community operations. However, they overlooked the subjectivity of community participants.

In summary, a framework for optimally coupling shared ESS capacity with community operations, which considers both overall economics and participant subjectivity, has never been implemented. To address this gap, this study established a two-layer optimization framework that takes into account the subjectivity of community participants, aiming to collaboratively optimize the size of shared ESS and the operation of the energy community.

3. Methodology

This study proposes a framework for sharing ESS and energy in an energy community, considering the subjectivity of participants. Initially, a two-layer nested model was developed to plan the shared ESS capacity and simulate interactions within the energy community. Then, the entities in the energy community were decoupled in the interaction model. Third, indicators were provided for evaluating the technical, economic, and environmental performance of the energy system. A model solution scheme was subsequently proposed, based on a nested algorithm that combines the Nondominated Sorting Genetic Algorithm II (NSGA-II) with Gurobi, to obtain the Pareto front. Finally, the Technique of Order Preference by Similarity to an Ideal Solution (TOSIS) method was used to select the optimal solution from the Pareto frontier design solutions, and the entropy weight method was applied to weigh the indicators and obtain the optimal design solution.

3.1. Energy Community Architecture

An energy community comprises DGSs that exchange energy and services according to community rules. Each DGS includes generating equipment, load demands, distribution lines, and communication links and is assumed to be directly connected to the public grid via a local bus, as illustrated in Figure 1.

Typically, a distributed generation system operator (DGSO) owns a DGS. An energy community aggregates adjacent DGSs, providing an energy-trading platform and a shared ESS. The ECO is responsible for the cooperative operation of the shared ESS and all DGSs, thereby offering additional flexibility to participants. The DGSO informs the ECO of any power surplus or shortage. After collecting data from the DGSOs, the ECO coordinates electricity transactions between internal systems through optimized scheduling and internal market transaction mechanisms, aiming to reduce electricity traded with the public grid and enhance the community’s profits. Additionally, the ECO must establish contracts with DGSOs, with clearly defined perimeter and intracommunity trading rules. The latter compensates the ECO for their participation in the energy community.

This study concentrated on shared ESS planning and community dispatching to realize the hierarchical management of the energy community, including shared ESSs. Simulations were conducted at 1-hour intervals, considering public grid and community energy prices, forecasted generation, and DGS loads. It is important to note that each DGS was regarded as an independent entity of interest, and this study did not consider the interest relationship within the DGS.

3.2. Two-Layer Nested Optimization Method

The hierarchical structure of the optimization model is illustrated in Figure 2. During the optimization process, the economic dispatch within an energy community is influenced by the installed capacity of the shared ESS, which, in turn, impacts the economic dispatch of the energy community. This study addresses two optimization problems: optimizing the shared ESS capacity and economic dispatch of the energy community. Consequently, a two-layer optimization model is constructed.

Furthermore, subjectivity issues are addressed in the lower-layer optimization problem. The energy community and DGSs are distinct entities, each lacking the right to access information about the other, and each entity is profit-driven, pursuing its interests. This means that each entity has its objective function and constraints. It presents a mathematical modelling challenge where the energy community operates at the parent layer, and the DGSs are at the child layer.

3.2.1. Upper-Layer Problem

The upper-layer optimization model employs a multiobjective method to optimize the installed capacity of the shared ESS (). The first objective function () of the upper-layer optimization problem aims to minimize the total cost of the shared ESS, which includes investment, replacement, and operation costs, along with profits. It is important to highlight that the cost of using shared ESS is amortized through each transaction between DGSs and the energy community. The total cost of the shared ESS is defined as where , , and represent the installation, replacement, and operating costs of the shared ESS, respectively; and are the charging and discharging powers of the shared ESS at , respectively; is the shared ESS usage cost; and are the quantities of electricity recommended for purchasing from and selling to the energy community, respectively; is the life span of the shared ESS; is the optimized time interval; is the optimization duration; and is the capital recovery factor [24]. where represents the project life and is the actual discount rate, expressed as where is the nominal discount rate and is the inflation rate.

The second objective function () aims to maximize the self-sufficiency rate (SSR), which is the proportion of demand met by the DGS, other community participants, or the shared ESS [24], excluding electricity imports from the public grid as a percentage of total electricity demand. It is expressed as where is the electricity imported by DGS from the public grid at and is the electricity demand of DGS at .

The feasible solution to the upper-layer optimization problem is limited by the maximum available installable capacity of the shared ESS. The constraint is expressed in constraint (6) as the investment restriction of the shared ESS. where and denote the shared ESS’s installed capacity and maximum available installable capacity, respectively.

3.2.2. Lower-Layer Problem

The lower-layer problem encompasses two optimization challenges: community economic scheduling (parent layer, ) and DGS optimal scheduling (child layer, ).

(1) Parent Layer. The energy community coordinates electricity transactions between the DGSs and dispatches shared ESSs in community economic scheduling. Decision variables include the recommended transaction volume between DGSs and the energy community ( and ), the charging/discharging power of shared ESS ( and ), and the available capacity () in each time interval. As compensation for balancing electricity between DGSs, the energy community receives management fees () from the DGSs. Additionally, the energy community charges the DGSs for using the shared ESS () and incurs the operating costs of the shared ESS (). The community operating costs are defined as follows: where and represent the community unit management fee and the shared ESS operating cost, respectively.

Constraints (9)–(11) limit the interaction between the energy community and DGSs. Constraint (9) ensures the power balance within the community at time . Power transmission between the DGSs and the energy community is limited by the line capacity, as represented by constraint (10). The DGSs are prohibited from purchasing electricity and selling electricity to the energy community at the same time. Constraint (11) guarantees the uniqueness of the transaction direction for each DGS within the energy community at time . where and are the maximum allowable powers of the tie lines between the DGS and the energy community, respectively.

Constraints (12)–(15) govern the operation of the shared ESS. The real-time charge storage () reflects the charge level of the ESS, which is constrained by constraint (12). Constraint (13) limits the charging and discharging power of the shared ESS at time . Constraint (14) ensures that the shared ESS cannot charge and discharge simultaneously. Constraint (15) restricts the amount of electricity stored in the shared ESS.

(2) Child Layer. DGSs can spontaneously interact with the energy community and public grid to fulfil the power demands of the end-users they serve. The goal of each DGS is to minimize the total operating cost, which includes the transaction cost with the energy community (), the transaction cost with the public grid (), management fees paid to the energy community (), and the cost of CO2 emissions from purchasing electricity from the public grid (). Decision variables encompass the transaction volume between DGSs and the energy community ( and ) and the transaction volume between DGSs and the public grid ( and ) at time . The total cost of a DGS () is expressed as where , , , and represent the energy community transaction price, time-of-use tariffs for electricity purchased from the public grid, fixed tariffs for electricity sold to the public grid, and the unit CO2 emission cost, respectively; is the CO2 emission factor; and and represent the electricity purchased from the public grid and the electricity sold to the public grid, respectively.

Constraints (18)–(21) govern the operation of each DGS. Constraint (18) ensures the power balance within each DGS. The line capacity limits the transaction power between the DGS and the energy community, as well as the interaction between the DGS and the public grid, as stated in constraint (19). Constraint (20) mandates the uniqueness of the transaction direction between the DGSs and the energy community and between the DGSs and the public grid, respectively. A DGS cannot purchase electricity from the energy community and sell electricity to the public grid at the same time, and vice versa. Constraint (21) ensures that the DGS aligns with the direction of transactions with the energy community and public grid. where and represent the available power from wind turbine (WT) and photovoltaics (PV) at time , respectively, and and are the maximum allowable powers of the tie lines between the DGS and the energy community, respectively.

Appendix A (or references [40, 41]) provides the mathematical model of the DGS components, including WT and PV.

3.2.3. Decoupling of the Lower-Layer Optimization Problem

The ECO must coordinate the DGSO’s community transactions, with coordination deemed complete only when the volume of recommended transactions matches the actual transactions. There is a clear coupling between the objectives of the parent layer (as seen in formula (7)) and the child layer (as seen in formula (16)), with the coupling variables being and and and . The energy community and DGSs, as separate entities with distinct interests, aim solely to optimize their objectives. They do not have the right to access the equipment information of the other parties and do not participate in the decision-making process of the other party during the scheduling process. Therefore, the coupling between the parent and the child layers must be decoupled.

The Analytic Target Cascading (ATC) method is applied to address the problem of coordinated operation between parent and child layers. Initially, the system is divided into subsystems by creating shared variables to replace the coupled ones. Subsequently, to guide and coordinate the decision-making process of both parties, the augmented Lagrangian form is utilized to design consistency constraints and penalty functions within each subsystem model. Finally, the optimization problem of each subsystem is solved independently, and the shared variable is optimized concurrently until convergence conditions are satisfied.

Following the steps of the ATC method, new shared variables ( and ) are created as target and response variables, respectively. Let and . The target variable and the response variable are introduced to the parent layer optimization model (as seen in formula (7)) and the child layer optimization model (as seen in formula (16)), respectively, with consistency constraints and quadratic penalty items added. Thus, the original model is converted to the following: where and represent the Lagrange multipliers and the weights of the penalty function, respectively. enhances the model’s convergence speed and local convexity to counteract the influence of discrete variables [42].

After decoupling, the ECO and DGSOs can optimize separately and then achieve coordination by continuously exchanging optimization results. The structure of the decoupled model is illustrated in Figure 3. The DGSOs in the child layer report the transaction volume with the energy community () to the ECO in the parent layer. Following coordination, the ECO will communicate the recommended transaction volume () back to the DGSOs. This process involves repeated information exchanges until the difference in information () between the parent layer and the child layer falls within an acceptable error range.

3.2.4. The Final Expression of the Optimization Problem

The two-layer nested optimization problem is ultimately expressed as follows:

It should be noted that, after the system is decoupled, the community optimization model introduces new directional constraints. The energy community is required to enforce consistency in the direction of the target and response variables when coordinating electricity transactions between DGSs.

3.3. Evaluation Indicators

To comprehensively evaluate the performance of the energy system, five indicators were employed in this study, considering technology, economy, and environment aspects: SSR, self-consumption rate (SCR), the total cost of the shared ESS, the operating costs of community participants, and CO2 emissions.

3.3.1. Technical Indicators

The independence of the energy system can be represented by the SCR and SSR as defined in formula (5).

The SCR is defined as the ratio of the self-consumed DGS electricity, excluding exported electricity, to the total electricity generated by DGSs; that is, the proportion of electricity that DGSs consume themselves [24].

3.3.2. Economic Indicators

The total cost of sharing the ESS, as defined in formula (1), and the operating costs of community participants, as outlined in formulas (7) and (16), were selected as indicators to evaluate the economic performance of the energy system.

3.3.3. Environmental Indicators

The total emission (TE) was considered as the environmental indicator for the energy system, which depended on the purchase of electricity from the public grid. The CO2 emission factor used in this study was associated with energy imported from the public grid.

3.4. Model Solution

This section introduces a nested algorithm to solve the nonlinear, two-layer nested optimization problem and determine the Pareto frontier. Additionally, a method to obtain a compromise solution within the Pareto feasible set is provided.

3.4.1. Nested Optimization Algorithm

A nested algorithm was developed to solve the two-layer nested optimization model. To ensure that high-quality solutions are not lost during the evolution process, this study utilized the NSGA-II to address the upper-layer multiobjective problem. The NSGA-II, proposed by Deb et al. [43] in 2002, is known for its fast optimization speed, good convergence of solution sets, and robust optimization results [44], making it extensively applied in multiobjective problems [45]. The lower-layer optimization problem was solved using Gurobi 9.0.3. All models were implemented in Python 3.6.

Figure 4 illustrates the flowchart of the nested optimization algorithm. The algorithmic process can also refer to Algorithm 1.

Step 1: Load basic information and initialize parameters of the upper-level optimization.
Initialize n=0.
Initialize the NSGA-II parameters according to Table 1.
Step 2: Randomly generate the 0th population.
Stochastically generate Ecap.
Step 3:Initialize parameters of the lower level optimization.
Initialize .
Initialize =0, =max (If ≥0) or =min (If <0).
Initialize and .
Step 4: Optimize the lower-level model.
 Solve optimization models (22) and (23) to obtain and by using solvers of Gurobi 9.0.3. The target vector () is constant in the child layer, and the result vector () is constant in the parent layer
Step 5: Check the stop criterion of the lower optimization.
If formula (27) is met, go to Step 7; otherwise go to Step 6.
Step 6: Update parameters of the lower optimization.
Update the Lagrange multipliers with formulas (28) and (29).
Update the step size γ with formulas (30).
Update .
Go to Step 4.
Step 7: Output the optimal solution of the lower-level optimization.
Step 8: Passing the optimal solution of the lower optimization to the upper optimization.
Step 9: Optimize the upper-level model.
Solve optimization models (1) and (5) to generate the (n+1)th population (Ecap) by using NSGA-II.
Step 10: Check the stop criterion of the upper optimization.
If the maximum generation in Table 1 is met, go to Step 12; otherwise, go to Step 11.
Step 11: Update the parameters of the upper optimization.
Update population by using NSGA-II.
Update n=n+1.
Go to Step 3.
Step 12: Output the optimal solution of the upper-level optimization.

The NSGA-II parameters are presented in Table 1.

The upper-level optimization process terminates only when convergence conditions are met. The ATC has the advantages of parallel optimization, unconstrained series, and strict convergence proofs. The proof of the convergence of ATC and its application in multilevel optimization is presented in reference [46]. For iteration , the convergence condition can be expressed as

The Lagrangian multiplier () and the coefficient of the quadratic penalty term () serve as coordination signals in the iterative solution process of the two-layer model. The updated rules for these parameters can be based on the augmented Lagrange multiplier method [47]. Constraint (28) outlines the updated rules for the Lagrangian multipliers of the parent and child layers, respectively. Constraint (29) specifies the updated rules for the penalty term coefficient.

The initial values of and are usually set as small constants, with having a more significant impact on iterative convergence compared to . Here, is strictly necessary for convex objective functions, while a range of is generally recommended for faster convergence. For nonconvex targets and large values of , the quadratic penalty term also acted as a local “convexizer” [47].

Furthermore, to accelerate the convergence speed of the algorithm, a step size () was introduced to update the optimal solution [48] as

3.4.2. Compromise Solution for Multiobjective Optimization

After optimizing the upper and lower layers, a Pareto front is obtained, with each solution being feasible. The TOSIS method in [49] is used to identify the compromise solution within the feasible solution set. The TOSIS method ranks a limited number of assessments based on their proximity to the desired goal, distinguishing between two idealized objectives: a positive ideal solution and a negative ideal solution. The most favourable solution is closest to the positive ideal objective and farthest from the negative ideal solution. Etghani et al. [50] and Boyaghchi and Sohbatloo [51] successfully integrated the genetic algorithm with the TOSIS method, yielding convincing results.

4. Case Study and Discussion

This section presents numerical cases designed to simulate interactions among community members. A multiobjective approach was utilized to optimize the size of the shared ESSs. The data sources involved in the optimization are listed in Appendix B (or references [40, 41]), including technical and economic parameters of system components, local meteorological conditions, required electrical loads, and an introduction to the electricity market. Subsequently, the trade-off between the objective functions was analyzed, and a compromise solution was obtained. Finally, the cases were designed to demonstrate the impact of adding shared ESSs and considering subjectivity on the technical, economic, and environmental performance of the energy community.

4.1. Simulation Results

The results of the NSGA-II method were analyzed. The Pareto frontier contains 50 feasible solutions for the shared ESS design. From the optimization results, it is evident that there is a correlation between the two indicators of the objective function. An increase in the total cost corresponds to a rise in the SSR. This is because an increase in the shared ESS capacity can reduce the amount of electricity purchased from the public grid, thereby enhancing the energy community’s SSR. However, this also leads to an increase in the total cost of the shared ESS.

To select the optimal solution from the Pareto feasible set in a multiobjective optimization problem, it is necessary to consider different indicators. The two indicators in the proposed optimization model are the total cost of shared ESS and SSR. Given that every solution in the Pareto feasible set is viable, a solution selection process is required to identify the optimal solution. The TOPSIS method, which is widely used for this purpose, selects the optimal solution based on the distance to the positive and negative ideal solutions, calculated using indicator preference. In this study, the entropy-weighing method was employed to determine the weight of each evaluation indicator. The entropy-weighing method, an objective weighting method, utilizes information entropy to calculate the weight of each indicator based on the dispersion degree of each indicator’s data. The positive and negative ideal solutions are listed in Table 2. The optimal solution is represented by the red five-pointed star in Figure 5.

4.2. Plan Selection

To assess the advantages of the optimal scheme, two comparison schemes were devised: the two objectives of the multiobjective function were treated as objectives of two separate single-objective functions. Specifically, the weight of the total cost of shared ESS was set to 1, and the weight of SSR was set to 0 for one scheme. For the other scheme, the weight of the total cost of shared ESS was set to 0, and the weight of the SSR was set to 1. The results obtained by applying these two settings to a multiobjective optimization framework are equivalent to the outcomes of two single-objective optimizations. The optimal results for different design schemes are summarized in Table 3.

The total cost-driven solution exhibited the lowest total cost of shared ESS within the Pareto solution set. However, this scheme resulted in the poorest performance in terms of the system’s SSR, SCR, and environmental performance were the worst. Furthermore, the SSR-driven scheme had the best SSR, SCR, and environmental performance, but the total cost of shared ESS was 178.50% higher than that of the optimal scheme. This analysis indicates that the optimal solution represents a balance and compromises among various indicators, showcasing good performance in technological, economic, and environmental terms. Notably, in the total cost-driven scheme, the shared ESS was not installed, highlighting the shared ESS’s limited economic benefits. Hence, the profits from intracommunity exchange were not sufficient to offset the shared ESS cost. In the optimal solution, the installed capacity of the shared ESS was 112 MW, which is substantial for the high investment cost; this is also evident in the total cost-driven solution. The adoption of renewable energy sources necessitates a large-capacity ESS.

4.3. Performance Analysis

This section examines the effects of incorporating a shared ESS and accounting for subjectivity on the technical, economic, and environmental performance of the energy community and DGSs.

4.3.1. Impact of Adding Shared ESS on the Performance of the Energy Community and DGSs

The impact of incorporating a shared ESS on the energy community and DGSs was first investigated. A case without a shared ESS served as a comparative baseline to quantify this impact. Energy imports serve as the basis for calculating indicators such as SSR, total community costs, and carbon CO2 emissions. Therefore, before analyzing these indicators, the annual and quarterly energy imports were presented and analyzed. Figures 6(a) and 6(b) depict the annual and quarterly energy import savings for the energy community and DGSs in both cases, respectively. The introduction of a shared ESS led to additional energy savings for the energy community and each DGS, especially during the hot summers and cold winters (as shown in Figure 6(b)). Throughout the year, the energy savings from the shared ESS case were significantly higher than those from the case without a shared ESS (approximately 49.78%). This aligns with the findings of Dhundhara et al. [24] regarding the positive impact of sharing ESS on community annual energy savings.

The technical, economic, and environmental performances of the energy community and DGSs in the non-ESS and shared ESS cases were evaluated. The outcomes are depicted in Figures 7(a)7(c), respectively. Incorporating a shared ESS markedly enhanced these three performances compared to the non-ESS case. The SSR and SCR increased by 16.22% and 21.98%, respectively, while the total operating cost and CO2 emissions decreased by 27.10% and 33.24%, respectively, as detailed in Table 4. The concurrent improvement in SSR and reduction in CO2 emissions can be attributed to the SSR being the proportion of electricity demand met without resorting to energy imports, which are sources of CO2 emissions. As illustrated in Figure 7(b), the shared ESS effectively reduced both the electricity bill of the DGS and their CO2 emission costs. This is because the shared ESS bolsters the community’s capacity for power supply and consumption, enabling more electricity transactions within the community rather than trading with the public grid.

Table 5 summarizes the annual costs and profits associated with the investments and operations of the shared ESS. The investment cost constitutes the largest share of the total cost, accounting for approximately 49.23%. The total annual operating profit of the shared ESS was negative, at −46.70 K$, indicating that the shared ESS is not economically viable under current conditions. Despite significant energy savings and potential reductions in electricity bills facilitated by a shared ESS, the savings are insufficient to cover the investment cost of the shared ESS. This observation aligns with the findings of previous studies [810]. The recovery of the investment cost for the shared ESS was beyond the scope of this study. However, with suitable regulations and policies to support investors in shared ESS, the energy community and its members could realize greater benefits.

Figure 8 illustrates the power flow to and from the energy community and DGSs in the non-ESS and shared ESS cases. Figures 8(a), 8(c), 8(e), and 8(g) display the optimal results for the non-ESS case. Similarly, Figures 8(b), 8(d), 8(f), and 8(h) show the optimal results for the shared ESS case. The direction of power flow is indicated by the sign, with power imported from the public grid shown as positive and power exported to the public grid shown as negative.

In the shared ESS case, most of the community’s electricity demand could be satisfied by the renewable energy generation of the DGSs within the energy community, especially when DGS power generation was substantial. Conversely, during periods of insufficient DGS generation, the shared ESS could fulfil part of the energy community electricity demand by utilizing the surplus renewable electricity injected into the public grid in the non-ESS case. As illustrated in Figures 8(d), 8(f), and 8(g), the interaction with the public grid was significantly reduced compared to the non-ESS case. This indicates that incorporating a shared ESS is advantageous for the energy community, as it diminishes both peak power demands and the community’s dependency on the public grid.

4.3.2. Impact of Subjectivity on the Performance of the Energy Community and DGSs

The energy community and DGSs are distinct stakeholders, regarded as rational entities capable of freely, voluntarily, and independently participating in the community’s internal market to maximize their interests. This study implemented a hierarchical approach to coordinate transactions among community members, aiming to maintain independence, protect privacy, and ensure data security. A centralized management scheme was designed to assess the impact of subjectivity on the energy community and DGSs.

The comparative case adopted the conceptual architecture of an energy community introduced by reference [12], wherein the internal market enables the sharing of community profits among participants to ensure each member profits more than if acting alone. The internal market setup was consistent with the hierarchical framework proposed in this study. The social welfare maximization method was employed to determine the electricity transaction volume among community members, thereby ensuring the efficient allocation of resources. Benefits accrued to the community were then shared among participants through the implementation of a nondiscriminatory sharing policy and the Sharply value approach [52].

Furthermore, the introduction of subjectivity into the energy community was investigated, and its effect was quantified through the reference case. Figure 9 illustrates the community’s technical, economic, and environmental performance in both centralized and hierarchical cases. Internal resources were coordinated effectively from the perspective of maximizing social welfare due to strong cooperation, resulting in the centralized approach performing well technically, economically, and environmentally. However, adopting a centralized framework necessitates the ECO acting as a benevolent planner, with the DGSO sacrificing subjectivity for absolute trust in the ECO. This requirement makes dispatch plans challenging to implement in an energy community with multiple stakeholders and diminishes the dynamism of the electricity market. Compared to the centralized method, the performance of the hierarchical approach experienced a slight reduction in all aspects, aligning with trends reported in other studies [52]. In the hierarchical case, the SSR and SCR decreased by 3.04% and the total operating costs and CO2 emissions increased by 3.26% and 6.86%, respectively, as presented in Table 6. The modest decline in performance highlights the difference between the local optima achieved through the hierarchical scheme that emerges as a viable choice and an alternative to existing models.

Considering subjectivity, benefits gap, power-market construction, network scale, computing performance, and other factors, the hierarchical scheme is a good choice and an alternative to existing schemes.

5. Conclusions

This study introduces a scheme for sharing energy and ESS within the energy community. A two-layer optimization framework is proposed enabling DGSs to engage in community energy transactions freely, voluntarily, and independently, while also considering participants’ privacy, thereby ensuring participant subjectivity. The framework is characterized by three main characteristics. First, DGSs can participate in community interactions freely, voluntarily, and independently. Second, only limited information is needed for interactions between community participants, fully addressing privacy protection and data security issues. Third, the optimization of shared ESS sizes and community energy interactions is integrated. Additionally, a technoenvironmental economic assessment of the proposed system was conducted. Finally, a case study was conducted to numerically evaluate the proposed model, and the effectiveness, applicability, and benefits of the proposed framework were discussed and validated. The following conclusions were drawn from this study: (1)Numerical simulation results indicate that shared ESSs effectively enhance community participants’ performance, leading to higher SSR and SCR. The SSR and SCR increased by 16.22% and 21.98%, respectively. An increase in SSR and SCR within a community significantly supports the public grid by reducing peak demand and renewable energy exports, especially in public grids with limited line capacity(2)The integration of shared ESSs enables the energy community and DGSs to efficiently use local generation and avoid unnecessary curtailments(3)The economic advantages are notable in the shared ESS case, which can lower the total operating cost of the community by 27.10%. However, the current high investment cost represents the main barrier to the financial viability of shared ESS(4)Shared ESSs have also been demonstrated to reduce carbon emissions. The energy community can reduce carbon dioxide emissions by 33.24% annually(5)With subjectivity considered, the SSR and SCR decreased by 3.04%, while the total operating cost and CO2 emissions increased by 3.26% and 6.86%, respectively. Nonetheless, a model that incorporates subjectivity enables DGSs to participate freely, voluntarily, and independently, enhancing market dynamics(6)Considering data security, performance, power market construction, and network scale, a hierarchical framework that considers subjectivity is a good choice

The method utilized in this study becomes computationally intensive when applied to an energy community that includes more than three DGSs, resulting in slower processing. Future efforts will be dedicated to enhancing the algorithm to improve computation speed. Moreover, while the framework proposed in this study is specific, it possesses the flexibility to be extended and applied to various scenarios, depending on factors such as weather conditions, available technologies, electricity market dynamics, and dispatch strategies. This study can act as a valuable reference for planning and operational purposes, aiding the decision-making process within the energy community and the shared ESS design process. Although this study presents a planning approach for shared ESSs within energy community settings, it does not address the ownership and capital recovery aspects of shared ESSs. Hence, future research will explore the capital recovery of shared ESSs under varying market conditions and investigate the profit model for shared ESSs.

Appendix

A. Supplementary Model

This section details the energy system components, including WT and PV.

The instantaneous WT output power concerning the wind speed at any time is defined as where is the wind speed at the WT hub of DGS at time and , , and are the WT’s rated, cut-in, and cut-out wind speeds for DGS , respectively.

The wind speed in the meteorological data needs to be converted to the wind speed at the hub height of the WT where is the wind speed per meteorological data at time , and are the WT hub height of DGS and wind speed measurement altitude, respectively, and is the wind shear coefficient [53].

Instantaneous PV output power at any time can be modelled as where is the PV derating factor, is the solar irradiance of DGS at time ,  W/m2 is the incident standard radiation, is the temperature loss coefficient, °C is the PV-panel-cell temperature under normal conditions, and is the converter efficiency.

The ambient temperature () needs to be converted to the hourly average cell temperature () of the PV module, expressed as where °C is the standard operating cell temperature, °C is the air temperature in the nominal terrestrial environment (NTE), and  W/m2 is the global solar flux.

B. Data Source

We considered three DGSs to cooperate to form an energy community. The power generation equipment and installed capacity of each DGS are shown in Table 7, and the corresponding power demand is shown in Figure 10(a). Meteorological data, including wind speed, temperature, and solar irradiance, for typical days of the four seasons at the location depicted in Figures 10(b) and 10(c), were used to calculate the output power of WTs and PVs.

The technical and financial parameters of DGS components are shown in Table 8. The technical and economic parameters of the same components of all DGSs are assumed to be the same. Still, their installed capacities are considered different. Time-of-use and fixed tariffs are used to purchase and sell electricity from the public grid, respectively, applicable in most cities in China. The tariff types described above can be changed to expand the model according to local market conditions. The community electricity price must be between the time-of-use and feed-in electricity prices. The community electricity price is determined by multiplying the time-of-use electricity price by a coefficient, and the coefficient is 0.8. The types of electricity tariffs used in this study are shown in Figure 11.

Nomenclature

Abbreviations
ATC:Analytic Target Cascading
DGS:Distributed generation system
DGSO:Distributed generation system operator
EC:Energy community
ECO:Energy community operator
ESS:Energy storage system
MAS:Multiagent system
NSGA-II:Nondominated Sorting Genetic Algorithm II
P2P:Peer-to-peer
PV:Photovoltaic
SCR:Self-consumption rate
SSR:Self-sufficiency rate
TOSIS:Technique of Order Preference by Similarity to an Ideal Solution
WT:Wind turbine.
Indexes and Sets
, :DGS index and set
:NSGA-II iteration index
:ATC iteration index
t, τ:Time index and set.
Parameters
:Unit management costs of the EC ($/kWh)
:Unit operational and maintenance costs of the shared ESS ($/kWh)
:Investment costs of the shared ESS ($)
:Costs of the DGS transactions with EC ($)
:Cost of CO2 emissions of the DGS m ($)
:Total operating costs of the DGS m ($)
TCESS:Total cost of the shared ESS ($)
:Costs of DGS transactions with public grid ($)
:Management fees paid by DGS to EC ($)
:Operation costs of the shared ESS ($)
:Replacement costs of the shared ESS ($)
TE:Total emissions (t)
:Income of the shared ESS ($)
:Management fees of the EC (K$)
:Profits of the EC (K$)
Constants
:Wind shear coefficient
, :Charge/discharge efficiency of the shared ESS (%)
:Electricity converter efficiency (%)
:CO2 emission factor (t/kWh)
:Quadratic penalty term update coefficient
:Update factor for step length
:Algorithmic precision
:Lagrange multipliers
:Quadratic penalty function coefficients
:Unit CO2 emission cost ($/t)
:Unit usage fee of the shared ESS ($/kWh)
:Time-of-use tariffs for public grid ($/kWh)
π man:Unit management fee of the EC ($/kWh)
π mg:Feed-in tariff ($/kWh)
:Intracommunity traded tariffs ($/kWh)
:Time interval in optimization (h).
:Unit investment costs of the shared ESS ($/kWh)
:Unit replacement costs of the shared ESS ($/kWh)
CRF:Capital recovery factor
:The maximum available installable capacity of the shared ESS (kWh)
:Minimum/maximum available capacity of the shared ESS (kWh)
:Inflation rate (%)
:Electricity load of the DGS at time (kW)
, :Maximum charge/discharge power of the shared ESS at time (kW)
:Photovoltaic power generation of the DGS at time (kW)
:Wind power generation of the DGS at time (kW)
, :Maximum power purchase/sale restrictions from/to EC for DGS at time (kW)
,:Maximum power purchase/sale restrictions from/to public grid for DGS at time (kW)
:Actual discount rate (%)
:Nominal discount rate (%)
:Optimization duration (h)
:ESS lifespan (yrs)
:Project life (yrs).
Variables
:Available capacity of the shared ESS at time (kWh)
E cap:Installable capacity of the shared ESS (kWh)
:DGS /EC predicted net electricity purchased from the EC for DGS at time (kWh)
, :Recommended electricity purchased from (sold to) the EC for DGS at time (kWh)
, :The electricity purchased from (sold to) the public grid for DGS at time (kWh)
, :The electricity purchased from (sold to) the EC for DGS at time (kWh)
, :Charge/discharge power of the shared ESS at time (kW).

Data Availability

The data used to support the findings of this study are included within the article.

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this study.

Authors’ Contributions

Xue Kong was responsible for the conceptualization, methodology, software, formal analysis, data curation, visualization, and writing—original draft. Hailin Mu was responsible for the supervision and funding acquisition. Hongye Wang was responsible for the conceptualization, methodology, supervision, funding acquisition, and writing a review and editing. Nan Li was responsible for the the supervision and conceptualization. Xiaoyu Liu was responsible for the data curation and visualization.

Acknowledgments

The study has been supported by the National Natural Science Foundation of China (No. 72304056). The study has also been supported by the Fundamental Research Funds for the Central Universities, China (DUT23RW405).