Distributed Shared Energy Storage Double-Layer Optimal Conﬁguration for Source-Grid Co-Optimization

: Shared energy storage is an energy storage business application model that integrates traditional energy storage technology with the sharing economy model. Under the moderate scale of investment in energy storage, every effort should be made to maximize the beneﬁts of each main body. In this regard, this paper proposes a distributed shared energy storage double-layer optimal allocation method oriented to source-grid cooperative optimization. First, considering the regulation needs of the power side and the grid side, a distributed shared energy storage operation model is proposed. Second, a distributed shared energy storage double-layer planning model is constructed, with the lowest cost of the distributed shared energy storage system as the upper-layer objective, and the lowest daily integrated operation cost of the distribution grid-distributed new energy stations as the lower-layer objective. Third, a double-layer iterative particle swarm algorithm combined with tide calculation is used to solve the distributed shared energy storage conﬁguration and distribution grid-distributed new energy stations’ economic operation problem. Finally, a comparative analysis of four scenarios veriﬁes that conﬁguring distributed shared energy storage can increase the new energy consumption rate to 100% and reduce the net load peak-valley difference by 61%. Meanwhile, distributed shared energy storage operators have realized positive returns.


Introduction
In order to cope with the environmental problems caused by global warming, new energy power generation is attracting great attention from all over the world [1].However, with the increasing scale of new energy access, the problem of imbalance between the intermittent power output and the spatial and temporal matching of the load has become more and more prominent, resulting in the phenomenon of wind and light curtailment and peak-to-valley differences increasing year by year [2,3].As a flexible power regulation resource, energy storage can achieve energy leveling at the spatial and temporal levels, promote local consumption of new energy, and reduce peak-to-valley differences [4,5].
Reasonable selection of the location and capacity of energy storage is important to improve the safety and economy of power system operation [6,7].There has been a lot of research on the optimal configuration of distributed energy storage.Ding et al. [8] established a double-layer coordinated siting and capacity optimization model for distributed PV and energy storage, where the upper layer optimizes the capacity and power of energy storage to minimize the annual integrated system cost, and the lower layer optimizes the grid connection location of energy storage with the objective of minimizing the system network loss.Gong et al. [9] used the dynamic planning method to solve for the distributed energy storage capacity and location to meet the operational needs of the active distribution network, with the whole life cycle cost of energy storage as the optimization objective.Li et al. [10] proposed a two-stage robust optimization model for the capacity configuration of integrated biogas-solar-wind energy systems applicable to rural areas, solving the configuration problem of energy storage in the first stage and the optimal operation of the system in the second stage.Guo et al. [11] first constructed a multi-attribute integrated index assessment model to determine the location of energy storage, and then a two-layer planning model to determine the storage capacity.
However, the current distributed energy storage investment costs are high [12,13], and the utilization efficiency is low [14].To address this issue, some scholars have conducted research on shared energy storage models.Shuai et al. [15] constructed an optimal allocation model for shared energy storage under multi-regional integrated energy system interconnection.Xie et al. [16] constructed a multi-micro grid shared energy storage two-layer planning model that takes into account the economic consumption of new energy sources.Yang et al. [17] selected three types of industrial users with different peak types as research objects and established a shared energy storage optimal allocation model to maximize the overall net benefit of multiple users.Liu et al. [18] proposed a producer-consumer energy-sharing mechanism and verified that the new energy consumption rate can be improved by sharing energy storage.
In summary, research on shared energy storage configurations is still in its infancy.Existing research mainly focuses on centralized shared energy storage, a single type of shared energy storage user, with less analysis on the cost settlement between shared energy storage users and shared energy storage.Based on the above problems, this paper proposes a distributed shared energy storage double-layer optimal allocation method for source-grid co-optimization.First, a distributed shared energy storage operation model for source-grid co-optimization is proposed.Secondly, a distributed shared energy storage twolayer planning model is constructed, and a two-layer iterative particle swarm algorithm combined with tide calculation is used to solve the distributed shared energy storage configuration and distribution grid-distributed new energy stations' economic operation problem.Finally, the effectiveness and economy of the proposed configuration method are verified by simulation analysis of arithmetic cases.
In this paper, the main innovations of this paper are as follows: 1.
There are limitations on storage power ratings, line transmission capacity, etc., so centralized shared storage no longer meets demand in actual use.Therefore, this paper investigates the optimal allocation of distributed shared energy storage; 2.
This paper proposes a distributed shared energy storage operation model oriented to source-network co-optimization, and analyzes the operation mode of each subject and the profit mechanism of the shared energy storage operator; 3.
Most of the existing literature considers energy storage sharing in the context of multiple single subjects, e.g., multi-industrial users, multi-microgrids, etc.In this paper, we consider the energy storage contribution of distributed new energy stations and distribution grids.In addition, this paper constructs a double-layer planning model for distributed shared energy storage, which comprehensively considers the operating costs of distributed shared energy storage operator and distribution griddistributed new energy stations and realizes the maximization of the interests of each subject.

Distributed Shared Energy Storage Operation Model for Source-Grid Co-Optimization
Shared energy storage is an energy storage business application model that integrates traditional energy storage technology with the sharing economy model, which is an energy storage power plant invested by a third party to provide charging and discharging services for multiple subjects.The distributed shared energy storage studied in this paper takes into account the regulation needs of both the power side and the grid side, and the schematic diagram of the distributed shared energy storage operation model for source-grid cooptimization is shown in Figure 1.
Processes 2023, 11, x FOR PEER REVIEW 3 of 18 services for multiple subjects.The distributed shared energy storage studied in this paper takes into account the regulation needs of both the power side and the grid side, and the schematic diagram of the distributed shared energy storage operation model for sourcegrid co-optimization is shown in Figure 1.Distributed shared energy storage operators are responsible for the operation and management of multiple energy storage plants.Each energy storage is connected to the distribution grid.A distributed new energy station is responsible for the operation and management of multiple new energy power stations.Each new energy station is connected to the distribution grid.The operational objectives of each of the distributed shared energy storage operators, distributed new energy stations, and distribution grid are described below: Shared energy storage operators aim to provide charging and discharging services for distributed new energy sites and distribution grids to achieve the lowest capacity allocation and operating costs for distributed shared energy storage systems.At the optimal allocation level, energy storage operators will aggregate the charging and discharging needs of distributed new energy sites and active distribution grids to centralize and optimize the allocation of distributed shared energy storage system capacity.At the optimized operation level, shared energy storage operators provide charging and discharging services, and charge service fees while trading power through "low storage and high discharge" to achieve price arbitrage.
Distributed new energy stations aim to maximize the utilization of distributed new energy power generation and reduce the rate of wind and light curtailment by utilizing the charging and discharging services of distributed shared energy storage plants.The distributed new energy stations will give priority to the distribution grid to support its load, and if the new energy output exceeds the demand of the distribution grid, the excess new energy output will be charged to the distributed shared energy storage system in the form of electricity sales.
The distribution grid aims to reduce the net load peak-to-valley differential by utilizing the charging and discharging services of distributed shared energy storage plants.In the distribution grid, priority will be given to the consumption of new energy output to meet the load demand, and the power imbalance will be the net load of the distribution grid.During peak load periods, the distribution grid will shave peaks by discharging power from distributed shared energy storage systems or purchasing power from the main grid.During low load periods, the distribution grid will be filled by charging from a distributed shared energy storage system to further reduce the net load peak-to-valley difference.Distributed shared energy storage operators are responsible for the operation and management of multiple energy storage plants.Each energy storage is connected to the distribution grid.A distributed new energy station is responsible for the operation and management of multiple new energy power stations.Each new energy station is connected to the distribution grid.The operational objectives of each of the distributed shared energy storage operators, distributed new energy stations, and distribution grid are described below: Shared energy storage operators aim to provide charging and discharging services for distributed new energy sites and distribution grids to achieve the lowest capacity allocation and operating costs for distributed shared energy storage systems.At the optimal allocation level, energy storage operators will aggregate the charging and discharging needs of distributed new energy sites and active distribution grids to centralize and optimize the allocation of distributed shared energy storage system capacity.At the optimized operation level, shared energy storage operators provide charging and discharging services, and charge service fees while trading power through "low storage and high discharge" to achieve price arbitrage.
Distributed new energy stations aim to maximize the utilization of distributed new energy power generation and reduce the rate of wind and light curtailment by utilizing the charging and discharging services of distributed shared energy storage plants.The distributed new energy stations will give priority to the distribution grid to support its load, and if the new energy output exceeds the demand of the distribution grid, the excess new energy output will be charged to the distributed shared energy storage system in the form of electricity sales.
The distribution grid aims to reduce the net load peak-to-valley differential by utilizing the charging and discharging services of distributed shared energy storage plants.In the distribution grid, priority will be given to the consumption of new energy output to meet the load demand, and the power imbalance will be the net load of the distribution grid.During peak load periods, the distribution grid will shave peaks by discharging power from distributed shared energy storage systems or purchasing power from the main grid.During low load periods, the distribution grid will be filled by charging from a distributed shared energy storage system to further reduce the net load peak-to-valley difference.

Double-Layer Planning Model for Optimal Allocation of Distributed Shared Energy Storage
Double-layer planning divides the problem into two layers: upper-layer optimization and lower-layer optimization [19].The upper-and lower-layer optimization models have their own optimization objectives, constraints, and decision variables.A schematic diagram of the distributed shared energy storage double-layer planning model in this paper is shown in Figure 2. From the figure, it can be seen that the upper and lower optimization problems are coupled with each other through the parameter transfer between layers.The upper-layer model passes the decision variables, i.e., the rated capacity and rated power of the distributed shared energy storage, to the lower-layer model as the constraints of the lower-layer model.The lower-layer model seeks the optimization of the charging and discharging power and position of each energy storage on this basis and feeds the optimization results of the power exchange between each body to the upper layer.The optimal values of the upper and lower layers are obtained through continuous iteration.Double-layer planning is used to find the lower layer optimum under the condition of the upper layer optimum, thus maximizing the interests of each subject.

Double-Layer Planning Model for Optimal Allocation of Distributed Shared Energy Storage
Double-layer planning divides the problem into two layers: upper-layer optimization and lower-layer optimization [19].The upper-and lower-layer optimization models have their own optimization objectives, constraints, and decision variables.A schematic diagram of the distributed shared energy storage double-layer planning model in this paper is shown in Figure 2. From the figure, it can be seen that the upper and lower optimization problems are coupled with each other through the parameter transfer between layers.The upper-layer model passes the decision variables, i.e., the rated capacity and rated power of the distributed shared energy storage, to the lower-layer model as the constraints of the lower-layer model.The lower-layer model seeks the optimization of the charging and discharging power and position of each energy storage on this basis and feeds the optimization results of the power exchange between each body to the upper layer.The optimal values of the upper and lower layers are obtained through continuous iteration.Doublelayer planning is used to find the lower layer optimum under the condition of the upper layer optimum, thus maximizing the interests of each subject.

Upper-Layer Model
The upper-layer model is used to solve the distributed shared energy storage plantrated capacity problem.The lowest cost of the distributed shared energy storage system is used as the objective function to plan the rated capacity and rated power of distributed shared energy storage.

Objective Function
The upper-layer optimization objective is the lowest cost of a distributed shared energy storage system, which can be expressed as where 1 C is the cost of a distributed shared energy storage system; sto C is the average daily investment and maintenance cost of distributed shared energy storage; new C is the cost of trading electricity between distributed shared energy storage and distributed new energy stations; adn C is the electricity transaction cost between distributed shared energy storage and the distribution grid; and ser C is the distributed shared energy storage ca- pacity lease service fee.The average daily investment and maintenance cost of distributed shared energy storage is expressed as

Upper-Layer Model
The upper-layer model is used to solve the distributed shared energy storage plantrated capacity problem.The lowest cost of the distributed shared energy storage system is used as the objective function to plan the rated capacity and rated power of distributed shared energy storage.

Objective Function
The upper-layer optimization objective is the lowest cost of a distributed shared energy storage system, which can be expressed as where C 1 is the cost of a distributed shared energy storage system; C sto is the average daily investment and maintenance cost of distributed shared energy storage; C new is the cost of trading electricity between distributed shared energy storage and distributed new energy stations; C adn is the electricity transaction cost between distributed shared energy storage and the distribution grid; and C ser is the distributed shared energy storage capacity lease service fee.The average daily investment and maintenance cost of distributed shared energy storage is expressed as where n is the number of energy storage units; r is the discount rate; y is the life cycle of energy storage equipment; δ p and δ e are the investment cost per unit power and capacity of energy storage, respectively; P sto,i and E sto,i are the rated power and capacity of energy storage, respectively; and δ m is the maintenance cost per unit power.
The cost of trading electricity between distributed shared energy storage and distributed new energy stations is expressed as where T is 24; N is the number of distributed new energy stations; δ t new is the selling electricity price per unit electricity of distributed new energy stations at time t; and P t sto,new,j is the power selling from new energy station j to distributed shared energy storage system at time t.
The electricity transaction cost between distributed shared energy storage and the distribution grid is expressed as where δ t sto is the selling electricity price per unit electricity of distributed shared energy storage at time t; δ t adn is the selling electricity price per unit electricity of the distribution grid at time t; P t sto,adn,d is the electricity sold by the distributed shared energy storage system to the distribution grid at time t; and P t sto,adn,c is the electricity sold by the distribution grid to the distributed shared energy storage system at time t.
The distributed shared energy storage capacity lease service fee is expressed as where δ s is a unit power service fee paid by the distribution grid and distributed new energy stations to the distributed shared energy storage system.

Constraint Condition
The energy multiplier constraint can be expressed as where β is the energy storage battery rate, which refers to the energy ratio constraint between the capacity of the energy storage battery and the rated power.The distributed shared energy storage power constraint can be expressed as where P sto,i,min and P sto,i,max are the minimum and maximum power of distributed shared energy storage installed at each node, respectively.The distributed shared energy storage charging and discharging power constraint can be expressed as The distributed shared energy storage charge constraint can be expressed as where E t sto,i is the charge of energy storage i at time t and η sto,c and η sto,d are the charging and discharging efficiency of energy storage, respectively.

Lower Layer Model
The lower-layer model is used for solving distributed shared energy storage siting and distribution grid-distributed new energy stations economic operation problems.The objective is to optimize each energy storage's location and charging and discharging power, achieving the lowest comprehensive daily operating cost of the distribution of grid-distributed new energy stations.

Objective Function
The lower-layer optimization objective is to achieve the lowest integrated daily operating cost of the distribution grid-distributed new energy stations, which can be expressed as where C grid is the cost of electricity purchased from the main grid by the distribution grid and C peak−valley is the penalty cost of the net load peak-to-valley difference.
The cost of electricity purchased from the main grid by the distribution grid is expressed as where δ t p is the price of electricity sold by the main grid at time t and P t grid is the power sold by the main grid to the distribution grid at time t.
The penalty cost of the net load peak-to-valley difference is expressed as where δ peak−valley is the net load peak-valley difference unit power penalty cost of 0.65 Yuan/kW [20]; L max load and L min load are the net load maximum and minimum values, respectively; L t load is the net distribution grid load at time t; P t load,k is the load at the node k at time t; and P t adn,new,j is the power sold by the new energy station j to the distribution grid at time t.

Constraint Condition
The capacity constraint of a distributed new energy site can be expressed as where P t new,j is the actual output of the new energy station j at time t and P t new_0,j is the ideal output of the new energy station j.
The distributed new energy stations and distributed shared energy storage purchase and sale constraint can be expressed as where P max sto,new is the maximum interactive power between the new energy station and the distributed shared energy storage.
The power balance constraint of distributed new energy stations can be expressed as The distribution grid and distributed shared energy storage purchase and sale constraint can be expressed as where B t sto,adn,d and B t sto,adn,c are the flag bits of the power interaction between the distribution grid and distributed shared energy storage and P max sto,adn is the maximum interaction power between the distribution grid and distributed shared energy storage.
The distribution grid power balance constraint can be expressed as where P loss,t is the net loss of the distribution network at time t.
The node power balance constraint can be expressed as where P t i and Q t i are the active and reactive power injected at node i at time t, respectively; U t i and U t j are the voltage amplitudes at node i at time t, respectively; G ij and B ij are the conductance and susceptance between nodes i and j, respectively; and θ ij is the phase angle difference between nodes i and j.
The node voltage constraint can be expressed as where U i,min and U i,max are the minimum and maximum values of the voltage amplitude of node i, respectively.The branch circuit capacity constraint can be expressed as where S t ij is the transmitted power between nodes i and j at time t, and S ij,max is the maximum value of the transmittable power between nodes i and j.
There is a nomenclature table in the Nomenclature section to navigate each symbol used in the paper.

Double-Layer Planning Model Solving
In the process of siting and setting the capacity of distributed shared energy storage, it is necessary to first consider the optimal economy of the distributed shared energy storage system, and then on this basis, consider the lowest operating costs of the distribution grid and distributed new energy station.The double-layer planning model based on the siting and capacity determination of distributed shared energy storage is a mutually coupled nonlinear multi-objective problem and contains multiple variables of different types.Therefore, this paper uses a double-layer iterative particle swarm algorithm combined with tidal wave calculation for the solution, as shown in Figure 3.

Case Setup
The algorithm uses a modified IEEE-33 node as the object of study.Among them, the IEEE-33 node is used as a distribution grid system [21]; 1000 kW PV is connected at node 9, and 1000 kW wind power is connected at node 20 as distributed new energy stations.For the distributed shared energy storage system, the allowed access nodes are 2-33, with a maximum of 6 energy storage accesses; the minimum rated power of energy storage access is 100 kW, the maximum rated power is 1000 kW, the discount rate of energy storage is 0.05 [20], the service life is 15 years [8], the unit power investment cost is 1173 Yuan/kW [20], the unit capacity investment cost is 1650 Yuan/(kW•h) [8], the unit power maintenance cost is 97 Yuan/(year•kW) [20], the energy storage unit power service fee is 0.05 Yuan/(kW•h) [20], the energy storage charging efficiency is 0.95 [20], and the energy storage discharging efficiency is 0.9 [8].The modified IEEE-33 node is shown in Figure 4.The electricity sales tariffs between subjects [22] are shown in Table 1.The load power and the output of each new energy station for a typical day are shown in Appendix A. The upper model is solved by a particle swarm algorithm, where each particle consists of two parts: the rated power of each energy storage (P sto,i ) and the rated capacity of each energy storage (E sto,i ).The lower model is solved using a particle swarm algorithm combined with a tide calculation, where each particle also includes two parts: the location of each energy storage (x i ) and the charging and discharging power of each energy storage (P t sto,i,c and P t sto,i,d , respectively).The upper model passes upper-level particles to the lower model as constraints for the lower model.The lower-layer model seeks the optimization of the charging and discharging power and position of each energy storage on this basis, and feeds the optimization results of the power exchange between the subjects to the upper layer.The optimal values of the upper and lower layers are obtained through continuous iteration.

Case Setup
The algorithm uses a modified IEEE-33 node as the object of study.Among them, the IEEE-33 node is used as a distribution grid system [21]; 1000 kW PV is connected at node 9, and 1000 kW wind power is connected at node 20 as distributed new energy stations.For the distributed shared energy storage system, the allowed access nodes are 2-33, with a maximum of 6 energy storage accesses; the minimum rated power of energy storage access is 100 kW, the maximum rated power is 1000 kW, the discount rate of energy storage is 0.05 [20], the service life is 15 years [8], the unit power investment cost is 1173 Yuan/kW [20], the unit capacity investment cost is 1650 Yuan/(kW•h) [8], the unit power maintenance cost is 97 Yuan/(year•kW) [20], the energy storage unit power service fee is 0.05 Yuan/(kW•h) [20], the energy storage charging efficiency is 0.95 [20], and the energy storage discharging efficiency is 0.9 [8].The modified IEEE-33 node is shown in Figure 4.The electricity sales tariffs between subjects [22] are shown in Table 1.The load power and the output of each new energy station for a typical day are shown in Appendix A.

Case Setup
The algorithm uses a modified IEEE-33 node as the object of study.Among them, the IEEE-33 node is used as a distribution grid system [21]; 1000 kW PV is connected at node 9, and 1000 kW wind power is connected at node 20 as distributed new energy stations.For the distributed shared energy storage system, the allowed access nodes are 2-33, with a maximum of 6 energy storage accesses; the minimum rated power of energy storage access is 100 kW, the maximum rated power is 1000 kW, the discount rate of energy storage is 0.05 [20], the service life is 15 years [8], the unit power investment cost is 1173 Yuan/kW [20], the unit capacity investment cost is 1650 Yuan/(kW•h) [8], the unit power maintenance cost is 97 Yuan/(year•kW) [20], the energy storage unit power service fee is 0.05 Yuan/(kW•h) [20], the energy storage charging efficiency is 0.95 [20], and the energy storage discharging efficiency is 0.9 [8].The modified IEEE-33 node is shown in Figure 4.The electricity sales tariffs between subjects [22] are shown in Table 1.The load power and the output of each new energy station for a typical day are shown in Appendix A.   To analyze the rationality of distributed shared energy storage configuration, four scenarios are set up in this paper for comparative analysis.
Scenario 1: no energy storage is configured, the excess power from distributed new energy stations is directly curtailed, and the power imbalance of the distribution grid is directly purchased from the main grid.
Scenario 2: the distribution grid, new energy station 1 (node 20 access wind power station), and new energy station 2 (node 9 access PV station) invest in the construction of energy storage on their own to achieve peak shaving and fill the valley and improve the consumption rate of new energy.Parameters such as the energy storage discount rate are the same as for distributed shared energy storage.
Scenario 3: configuration of different numbers of shared energy storage.Discusses the economic impact of configuring shared energy storage on the system under the constraint of the number of shared energy storage.Scenario 4: distributed shared energy storage is configured according to the method proposed in this paper, using distributed shared energy storage to cut peaks and fill valleys and improve the consumption rate of new energy.

Analysis of the Impact of Distributed Shared Energy Storage Systems on Peak Shaving and New Energy Consumption
The power balance of the distribution network for scenario 1 and scenario 4 is shown in Figure 5.In Figure 5, the positive power represents the power supplied to the distribution grid from outside, the negative power represents the network loss within the distribution grid and the power consumed by all electrical loads, and the difference between the maximum and minimum values of the net load curve is the peak-to-valley difference.
the same as for distributed shared energy storage.
Scenario 3: configuration of different numbers of shared energy storage.Discusses the economic impact of configuring shared energy storage on the system under the constraint of the number of shared energy storage.
Scenario 4: distributed shared energy storage is configured according to the method proposed in this paper, using distributed shared energy storage to cut peaks and fill valleys and improve the consumption rate of new energy.

Analysis of the Impact of Distributed Shared Energy Storage Systems on Peak Shaving and New Energy Consumption
The power balance of the distribution network for scenario 1 and scenario 4 is shown in Figure 5.In Figure 5, the positive power represents the power supplied to the distribution grid from outside, the negative power represents the network loss within the distribution grid and the power consumed by all electrical loads, and the difference between the maximum and minimum values of the net load curve is the peak-to-valley difference.Analyzing the power balance diagram of the distribution network in scenario 1, we can see that the distribution grid gives priority to the power provided by the distributed new energy stations, and when the power provided by the distributed new energy stations is insufficient, the distribution grid purchases power directly from the main grid to meet the power demand of the load.The load has peak and valley characteristics, but the new energy output has anti-peak characteristics.From Figure 5a, we can see that in 1-5 h and 14-16 h, the load is less but the new energy output is larger, resulting in a net load curve close to 0. However, in 9-12 h and 18-21 h, the peak load increases but the new energy output decreases, and the distribution grid can only purchase a large amount of power from the main grid.Based on the net load curve, it can be seen that the peak-to-valley difference for scenario 1 is 3040 kW.
Analyzing the power balance diagram of the distribution grid in scenario 4, we can see that the distribution grid gives priority to consuming the power provided by distributed energy stations; during the low-load period of 1-8 h, the distribution grid fills the valley by selling power to distributed shared energy storage; during the peak load periods of 9-12 h and 18-21 h, the distribution grid cuts the peak by purchasing power from distributed shared energy storage, thus reducing the net load peak-to-valley difference of the distribution grid.Based on the net load curve, it can be seen that the peak-to-valley difference for scenario 4 is 1120 kW, which is 63% lower than that of scenario 1.
The power balance of distributed new energy sites for scenario 1 and scenario 4 is shown in Figure 6.In Figure 6, the positive power represents the power output of each new energy station, and the negative power represents the power sold by each new energy station to the distribution grid and the distributed shared energy storage system.The ideal power output of distributed new energy stations represents the sum of the maximum power available from all new energy stations in that period.
Analyzing the power balance diagram of distributed new energy stations in scenario 1, we can see that the distribution grid cannot consume all the new energy output at 2-6 h and 15 h, at which time there is power curtailment in distributed new energy stations, and the power curtailed by wind and light is 1455 kW.Scenario 4 is equipped with distributed shared energy storage.When the distribution grid cannot consume all the new energy output, the distributed new energy stations sell the excess power to distributed shared energy storage to improve the new energy consumption rate, and the new energy consumption rate of scenario 4 is 100%.
uted energy stations; during the low-load period of 1-8 h, the distribution grid fills the valley by selling power to distributed shared energy storage; during the peak load periods of 9-12 h and 18-21 h, the distribution grid cuts the peak by purchasing power from distributed shared energy storage, thus reducing the net load peak-to-valley difference of the distribution grid.Based on the net load curve, it can be seen that the peak-to-valley difference for scenario 4 is 1120 kW, which is 63% lower than that of scenario 1.
The power balance of distributed new energy sites for scenario 1 and scenario 4 is shown in Figure 6.In Figure 6, the positive power represents the power output of each new energy station, and the negative power represents the power sold by each new energy station to the distribution grid and the distributed shared energy storage system.The ideal power output of distributed new energy stations represents the sum of the maximum power available from all new energy stations in that period.Analyzing the power balance diagram of distributed new energy stations in scenario 1, we can see that the distribution grid cannot consume all the new energy output at 2-6 h and 15 h, at which time there is power curtailment in distributed new energy stations, and the power curtailed by wind and light is 1455 kW.Scenario 4 is equipped with distributed shared energy storage.When the distribution grid cannot consume all the new energy output, the distributed new energy stations sell the excess power to distributed The economic benefits of scenario 1 and scenario 4 are shown in 2. Scenario 1 does not configure energy storage, so the total cost of the distributed shared energy storage system is 0. The daily integrated operating cost of the distribution grid-distributed new energy stations is 35,873 Yuan, the net load peak-to-valley difference is 3040 kW, and the phenomenon of wind and light curtailment exists.Scenario 4 is configured with distributed shared energy storage; the cost of the distributed shared energy storage system is −84 Yuan, the energy storage is profitable, and the distribution grid-distributed new energy stations' daily integrated operation cost is reduced by 1786 Yuan compared to scenario 1; the net load peak-to-valley difference is reduced by 1920 kW compared to scenario 1, and the new energy consumption rate is 100%.The comparative analysis of scenario 1 and scenario 4 verifies that the configuration of distributed shared energy storage can effectively reduce the peak-to-valley difference and improve the consumption rate of new energy.

Analysis of Distributed Shared Energy Storage Optimal Allocation Results and Charging and Discharging Behavior
The results of scenario 2 and scenario 4 energy storage optimization configurations are shown in Table 3, where the distribution grid energy storage in scenario 2 is configured with the peak-to-valley difference derived from scenario 4 as the constraint.It can be seen that the total configured capacity in scenario 2 is 9580 kW•h and the total configured capacity of distributed shared energy storage in scenario 4 is 6870 kW•h, which is 28% less than the total configured capacity in scenario 2. It can be seen that by reasonably sharing distributed energy storage, realizing the time, sharing multiplexing of energy storage, and improving the utilization rate of energy storage resources, the configuration of smaller power and capacity of energy storage can meet the demand for energy storage in distributed new energy stations and distribution grid.To see the utilization of energy storage resources more intuitively, this paper will analyze the results of scenario 4 energy storage charging and discharging behavior and charge state optimization, as shown in Figure 7. Positive power represents energy storage charging and negative power represents energy storage discharging.From Figure 7, it can be seen that both distributed shared energy storage 1 and 2 reach the maximum charging power in the low valley period and the maximum discharging power in the peak load period, i.e., both distributed shared energy storage 1 and 2 have full charging and full discharging behaviors.In addition, the distributed shared energy storage 1 reaches a maximum charge state of 0.9 at 6 h and a minimum charge state of 0.16 at 21 h.Distributed shared energy storage 2 reaches a maximum charge state of 0.9 at 6 h and a minimum charge state of 0.1 at 21 h, indicating that all distributed shared energy storage power reaches the upper or lower capacity limit.Distributed shared energy storage makes full use of energy storage capacity resources by aggregating the energy demand of distribution grids and distributed new energy sites and reasonably allocating each energy storage charge and discharge.
The economic benefits of scenario 2 and scenario 4 are shown in Table 4.It can be seen that the distributed shared energy storage system in scenario 4 is profitable, with a total cost of −84 Yuan and a combined daily operating cost of 2409 Yuan less for scenario 4's distribution grid-distributed new energy field station compared to scenario 2. Through the comparative analysis of scenario 2 and scenario 4, it is verified that the configuration of distributed shared energy storage can reduce the operating cost of distribution griddistributed new energy stations while taking into account the economics of shared energy storage investors to achieve a win-win situation for all parties.From Figure 7, it can be seen that both distributed shared energy storage 1 and 2 reach the maximum charging power in the low valley period and the maximum discharging power in the peak load period, i.e., both distributed shared energy storage 1 and 2 have full charging and full discharging behaviors.In addition, the distributed shared energy storage 1 reaches a maximum charge state of 0.9 at 6 h and a minimum charge state of 0.16 at 21 h.Distributed shared energy storage 2 reaches a maximum charge state of 0.9 at 6 h and a minimum charge state of 0.1 at 21 h, indicating that all distributed shared energy storage power reaches the upper or lower capacity limit.Distributed shared energy storage makes full use of energy storage capacity resources by aggregating the energy demand of distribution grids and distributed new energy sites and reasonably allocating each energy storage charge and discharge.
The economic benefits of scenario 2 and scenario 4 are shown in Table 4.It can be seen that the distributed shared energy storage system in scenario 4 is profitable, with a total cost of −84 Yuan and a combined daily operating cost of 2409 Yuan less for scenario 4's distribution grid-distributed new energy field station compared to scenario 2. Through the comparative analysis of scenario 2 and scenario 4, it is verified that the configuration of distributed shared energy storage can reduce the operating cost of distribution griddistributed new energy stations while taking into account the economics of shared energy storage investors to achieve a win-win situation for all parties.

Analysis of the Impact of Different Numbers of Energy Storage on the Economics of Distributed Shared System
To analyze the economic impact of configuring different numbers of energy storage on the distributed shared system, computational analysis was performed for scenario 3, and the cost of the distributed shared energy storage system with different numbers of energy storage as the constraint was obtained, as shown in Figure 8.

Analysis of the Impact of Different Numbers of Energy Storage on the Economics of Distributed Shared System
To analyze the economic impact of configuring different numbers of energy storage on the distributed shared system, computational analysis was performed for scenario 3, and the cost of the distributed shared energy storage system with different numbers of energy storage as the constraint was obtained, as shown in Figure 8.As can be seen from Figure 8, the cost of distributed shared energy storage tends to decrease and then increase as the number of energy storage increases.Due to the constraints of energy storage rated power, line transmission capacity, etc., as the number and scale of energy storage increases, the ability of distributed shared energy storage systems to consume new energy and peak shaving is increasing (i.e., the revenue of distributed shared energy storage is increasing), so the cost of distributed shared energy storage is on a downward trend.However, as the number and scale of energy storage continue to increase, the effect of new energy consumption and peak shaving tends to saturate, but the investment cost of energy storage is increasing, so the cost of distributed shared energy storage is on the rise.In this calculation example, the cost of distributed shared energy storage is at least −84 Yuan when the number of energy storage sites is 2, and the distributed shared energy storage operator achieves profitability.

Conclusions
This paper proposes a distributed shared energy storage optimal allocation method that takes into account both power-side and grid-side regulation requirements, integrates the optimization problems at both planning and operation levels, constructs a doublelayer model for distributed shared energy storage optimal allocation, and solves it using a double-layer iterative particle swarm algorithm combined with tide calculation, and draws the following main conclusions: By deploying distributed shared energy storage, distribution grid and new energy stations receive energy storage charging and discharging services at a lower cost, increas- As can be seen from Figure 8, the cost of distributed shared energy storage tends to decrease and then increase as the number of energy storage increases.Due to the constraints of energy storage rated power, line transmission capacity, etc., as the number and scale of energy storage increases, the ability of distributed shared energy storage systems to consume new energy and peak shaving is increasing (i.e., the revenue of distributed shared energy storage is increasing), so the cost of distributed shared energy storage is on a downward trend.However, as the number and scale of energy storage continue to increase, the effect of new energy consumption and peak shaving tends to saturate, but the investment cost of energy storage is increasing, so the cost of distributed shared energy storage is on the rise.In this calculation example, the cost of distributed shared energy storage is at least −84 Yuan when the number of energy storage sites is 2, and the distributed shared energy storage operator achieves profitability.

Conclusions
This paper proposes a distributed shared energy storage optimal allocation method that takes into account both power-side and grid-side regulation requirements, integrates the optimization problems at both planning and operation levels, constructs a doublelayer model for distributed shared energy storage optimal allocation, and solves it using a double-layer iterative particle swarm algorithm combined with tide calculation, and draws the following main conclusions: By deploying distributed shared energy storage, distribution grid and new energy stations receive energy storage charging and discharging services at a lower cost, increasing the new energy consumption rate to 100% and reducing the peak-to-valley difference by 61%.
Through the reasonable sharing of distributed energy storage, realize the time-sharing reuse of energy storage and improve the utilization rate of energy storage resources so that the configuration of smaller capacity energy storage can meet the demand for energy storage in distributed new energy stations and distribution grids.Distributed shared energy storage can reduce the allocated capacity by 28% compared to the standalone distribution storage scenario.
Through distributed shared energy storage system services and a reasonable number of energy storage configurations, distribution grids and distributed new energy stations can reduce their operating costs.At the same time, distributed shared energy storage operators realize positive returns, and there is potential for profitable investment in building distributed shared energy storage plants.

Figure 1 .
Figure 1.The schematic diagram of the distributed shared energy storage operation model for source-grid co-optimization.

Figure 1 .
Figure 1.The schematic diagram of the distributed shared energy storage operation model for source-grid co-optimization.

Figure 2 .
Figure 2. The schematic diagram of the distributed shared energy storage double-layer optimization model.

Figure 2 .
Figure 2. The schematic diagram of the distributed shared energy storage double-layer optimization model.

Figure 3 .
Figure 3.The flowchart for solving a two-tier model for optimal distributed shared energy storage allocation.(a) Flowchart for solving the upper model; (b) flowchart for solving the lower model.

Figure 3 .
Figure 3.The flowchart for solving a two-tier model for optimal distributed shared energy storage allocation.(a) Flowchart for solving the upper model; (b) flowchart for solving the lower model.

Figure 3 .
Figure 3.The flowchart for solving a two-tier model for optimal distributed shared energy storage allocation.(a) Flowchart for solving the upper model; (b) flowchart for solving the lower model.

Processes 2023 ,Figure 7 .
Figure 7.The distributed shared energy storage charge-discharge and charge state optimization results.(a) Distributed shared energy storage 1; (b) distributed shared energy storage 2.

Figure 7 .
Figure 7.The distributed shared energy storage charge-discharge and charge state optimization results.(a) Distributed shared energy storage 1; (b) distributed shared energy storage 2.

Figure 8 .
Figure 8.The distributed shared energy storage cost versus the number of energy storage.

Figure 8 .
Figure 8.The distributed shared energy storage cost versus the number of energy storage.

Figure A1 .
Figure A1.Load power graph for a typical day.Figure A1.Load power graph for a day.

Figure A1 .
Figure A1.Load power graph for a typical day.Figure A1.Load power graph for a day.
are the charging and discharging power of energy storage i at time t, respectively, and A t sto,i,c and A t sto,i,d are the charge and discharge flags of energy storage i at time t, respectively.

Table 1 .
The electricity sales price between each subject.

Table 2 .
Economic benefits of scenario 1 and scenario 4.

Table 3 .
The energy storage optimization configuration results of scenario 2 and scenario 4.

Table 4 .
Economic benefits of scenario 2 and scenario 4.
Author Contributions: Conceptualization, M.Y.; methodology, M.Y. and Y.Z.; software, J.L.; formal analysis, S.Y.; investigation, X.C.; resources, L.S.; writing-original draft preparation, H.L.; writing-review and editing, Z.F.All authors have read and agreed to the published version of the manuscript.The research was supported by the R&D project "Research on the Optimized Configuration and Operation Model of Distributed Shared Energy Storage to Promote Local Consumption of Renewable Energy-Research on multi-objective optimization model and operational strategy for shared energy storage (5217L0230003)" from the State Grid Henan Economic Research Institute.Research data have been provided in the manuscript.The authors declare no conflict of interest.
Funding: j the voltage amplitudes at node j at time t G ij the conductance between nodes i and j B ij the susceptance between nodes i and j θ ij the phase angle difference between nodes i and j U i,min the minimum values of the voltage amplitude of node i U i,max the maximum values of the voltage amplitude of node i S t ij the transmitted power between nodes i and j at time t S ij,max the maximum value of the transmittable power between nodes i and j Appendix A U the voltage amplitudes at node j at time t ij G the conductance between nodes i and j ij B the susceptance between nodes