Two-Stage Optimization Model of Centralized Energy Storage Participating in Peak Shaving with Maximum Reserve Capacity and Minimum Carbon Emission of the System

. As the proportion of renewable energy increases in power systems, the need for peak shaving is increasing. Te optimal operation of the battery energy storage system (BESS) can provide a resilient and low-carbon peak-shaving approach for the system. Terefore, a two-stage optimization model for grid-side BESS is proposed. First, the carbon emission model of thermal power units considering BESS is proposed to describe the ability of the BESS in reducing the carbon emissions. Second, in order to deal with the uncertainty of the photovoltaics and wind forecast errors, a certain capacity of BESS is reserved. Te model in the frst stage takes the lowest carbon emission of the system as the goal, and the model in the second stage determines the BESS reserve capacity with the objective of minimizing the risk cost of the system. Te simulation results show that the carbon emission model of thermal power units with BESS can measure the contribution of energy storage to emission reduction. By setting the reserve capacity of energy storage, the peak-shaving resilience of the system is improved, and the risk of photovoltaics and wind forecast error is reduced.


Introduction
As the installed capacity of wind power continues to increase, fexible adjustment resources are required to maintain safe and stable operation and power balance in the power system [1].Te requirements of peak shaving continue to increase due to the randomness and volatility of wind and solar power [2].Coal-fred power plants are the most popular resource for the peak-shaving service.However, thermal power unit fexibility transformation for peakshaving services is very expensive [3].Besides, participating in peak shaving through the operation of thermal power units will increase its coal consumption, operation and maintenance costs, and carbon emissions, which is inconsistent with a national goal of peak carbon emissions by 2030 and carbon neutrality by 2060 in China [3].Te corresponding speed of peak shaving by hydropower units is fast, but there is not enough hydropower for peak shaving in many areas due to the limitations of water resources and geography [4].Te peak-shaving capacity of hydropower is also limited by season, infow, reservoir regulation capacity, etc. Terefore, in order to achieve low-carbon and fexible peak shaving, new devices and operation strategy are required.
Te growth of renewable energy and the need for peak shaving have led to an exponential growth of grid support and storage installations around the globe.Consequently, by 2040 (accounting for 9 GW/17 GWh deployed as of 2018), the market will rise to 1095 GW/2,850 GWh, making a more than 120 times increase, based on a recent study published by Bloomberg New Energy Finance (BNEF) [5].Te fast and convenient control, simple requirements for geographical conditions, and high energy efciency of energy storage devices can meet the need for a balance between supply and demand [6,7].Most existing studies on energy storage analyze the economy of operation.For example, Hou et al. [8] developed a coupling operation model to optimize diferent energy storage devices for wind output power fuctuation smoothing, power imbalances mitigating, and peak load shaving with the maximum net earnings of the whole system.Authors in [9] proposed a resilient and peakshaving trade-of scheme for battery energy storage systems to reduce operational costs.Authors in [10] developed a complex control algorithm in order to optimize the use of energy storage devices for peak load shaving in fve diferent load demand profles.Although reducing the operational costs of battery energy storage is of great importance, sometimes the revenue of energy storage should give way to the interests of renewable energy or power users, such as the centralized battery energy storage system (BESS) on the grid side [5].
BESS can be used for stationary applications at every level of the network such as generation, transmission, and distribution as well as local industrial and commercial customers [5].At present, many countries and regions have successively built grid-side BESS.In the United States, Australia, and the Republic of Korea, grid-side BESS is mainly used to participate in the frequency modulation market and peak saving [11,12].Tere are also many gridside BESS projects in China.For example, the grid-side distributed BESS project in Henan Province provides instruction tracking and output fuctuations smoothening services for the local power grid [13].Zhicheng energy storage station, the frst grid-side lead-carbon BESS in China, is mainly used in two typical application scenarios, namely, peak shaving and frequency regulation [14].Te Langli BESS in Hunan province [15] adopts the operation mode of "twice charging and twice discharging" in one day to meet the peak-shaving demand of load peak at noon and in the evening in that the load peak-valley diference is relatively large.
Te research on centralized grid-side BESS is mainly about the economy of planning and operation.Authors in [16] developed a bi-level optimal locating and sizing model for a gridside BESS, and the direct revenue of this system is from the arbitrage of the peak-valley electricity price and auxiliary service compensation.Authors in [6] proposed a probabilistic approach for sizing large-scale battery storage with the aim of mitigating the net load uncertainty and quantifed the required BESS capacity for operating the wind plant without incurring excessive battery installation costs.A two-stage scheduling optimization model and solution algorithm for BESS with wind power considering uncertainty and demand response were proposed in [17].For two-stage stochastic optimization models, the optimal sizing and location of BESS considering wind power integration were determined in [18].Wind forecast errors will afect the operation of energy storage [19].Te existing research has not paid attention to the optimal operation of grid-side BESS, considering both the resilience issue of wind power and system carbon emissions in peak-shaving function [9,20].
Te measurement of the carbon emission reduction contribution of a certain device is conducive to the operation of the carbon market and carbon trading.In order to describe the carbon emission reduction contribution of gridside BESS, the carbon emission measurement of the system needs a more accurate description frst.
Terefore, in this paper, grid-side BESS is regarded as an independent centralized storage system, and its charge and discharge power are described and included in the carbon emission measurement of thermal power units.Te value of system carbon emission intensity reduced by energy storage is related to the carbon emission intensity of thermal power units.Moreover, if a certain reserve capacity is set during the operation of energy storage, the system operation risk caused by the uncertain resilience issue of wind power and photovoltaics can be reduced, and the resilience of the system can be increased.When the economy of energy storage is reduced, the reserve capacity of the energy storage system will be increased, and the operation economy of the whole power system can be improved.

Carbon Emission Model of Thermal Power Units with BESS
China's coal-based energy structure determines that coal accounts for more than half of the primary energy.Terefore, this paper sets thermal power units as coal-fred thermal power units to simplify the description of the carbon emissions of thermal power units.According to the law of energy conservation, in an ideal situation, 122.8 g of standard coal is consumed to produce 1 kWh of electric energy.However, in fact, the coal consumption is far greater than 122.8 g/(kWh), and there are additional carbon emissions.In order to quantify the contribution of BESS to emission reduction in the system, it is frst necessary to accurately describe the carbon emissions of thermal power units.
Te carbon emission intensity or rate of coal-fred thermal power units is the amount of carbon dioxide emissions generated by 1 kWh of electricity supply for a unit and is negatively related to the power load.Te higher the power load, the lower the carbon emission intensity [21].Trough linear ftting, the linear function relationship between the output of thermal power units and the carbon emission intensity is as follows [21]: where I g (P g G (t)) is the carbon emission intensity of the unit g at hourly time interval t, k ≥ 0, b ≥ 0 are linear coefcients, P g G (t) is the output of the unit g at time interval t, and P Gg is the installed capacity of the unit g.
Ten, the carbon emissions of the thermal power unit g can be calculated according to the following formula: where ∆t is the time between two consecutive time steps, in this paper, ∆t � 1.
Tere is power loss from energy storage in the process of charging and discharging, which will cause additional carbon emissions.Terefore, when the renewable energy and 2 International Transactions on Electrical Energy Systems thermal power units can meet the load demand, the carbon emissions of the system are the lowest because the energy storage is not required to participate in peak shaving and there are no additional carbon emissions.However, due to the forecast error of the power load and wind power and the limitation of the ramping power of thermal power units, it is necessary for BESS to meet the power balance needs and reduce the operation of thermal power units.
Te BESS can also increase the output of low-coal consumption units and reduce the output of high-coal consumption units through reasonable charging and discharging.For example, low-coal consumption units can generate more electricity to provide energy storage, and when load increases, energy storage is frst used instead of increasing the power of high coal consumption units.
Trough storing excess wind power and discharging to reduce the output of thermal power units when wind power is insufcient, the BESS can reduce the carbon emissions of the system.Te carbon emission model of thermal power units with BESS can be obtained as follows: where T is time intervals in one day, N G is the number of thermal power units, ω t is called the carbon emission intensity of BESS which is defned as carbon emission reduced by 1 kWh of charging or discharging, ω t is related to the carbon emission intensity of thermal power units, N B is the number of BESS, and P b c (t) and P b d (t) are charge and discharge power of the energy storage system b at time interval t.
Te charging and discharging power changes the output of the thermal power units, resulting in changes in the carbon emission intensity of the thermal power units, thus changing the carbon emission of the system.

Upper Limit of ω t .
Since there is power loss in the process of charging and discharging, the carbon emissions reduced by the BESS in formula (3) shall be less than the carbon emission of thermal power units.Terefore, the carbon emission intensity of BESS in formula (3) shall be less than the carbon emission intensity of thermal power units.And it can be ensured that wind power and photovoltaics instead of thermal power are used for energy storage charging.If the charging power is from thermal power units, the frst term and the second term in formula (3) will increase at the same time, and the coefcient of the frst term is greater than the second term, resulting in the increase of E c . (4)

Lower Limit of ω t .
Te carbon emission of the system will not increase during the charging and discharging of energy storage.Te value of ω t should be greater than 0.

Risk-Cost Function of Wind Forecast Error with Reserve
Capacity of BESS.Due to the randomness and fuctuation of wind power and photovoltaics, the operation of thermal power units and BESS is needed to maintain the balance between power generation and power consumption.In this paper, the wind forecast error is mainly considered.Te reserve capacity of fexible adjustment resources determines the allowable wind forecast error range.When the wind power exceeds the maximum allowable range, it will bring operational risks to the system and cause economic losses.Te probability density function p(∆P w W (t)) of the wind or photovoltaics forecast error ∆P w W (t) of wind farm w can be modeled as a Gaussian distribution [22,23].As shown in Figure 1, P w W+ (t) and P w W− (t), respectively, represent the upper and lower limits of the wind forecast error at time interval t.Te upper and lower adjustable capacity of thermal power units and BESS can be determined as [0, P w W+ (t)] and [P w W− (t), 0].When the wind forecast error at time t is less than P w W− (t), the adjustable resources are insufcient and part of the load needs to be cut of.When the wind forecast error at time interval t is higher than P w W+ (t), measures such as wind abandonment shall be taken.Terefore, the probability-weighted average of the shaded part in Figure 1 can be used to represent the risk of load shedding and wind abandonment caused by wind forecast error at time interval t.
Ten, the risk-cost of wind abandonment and load shedding can be expressed as follows: International Transactions on Electrical Energy Systems 3 where N W is the number of wind farms, P w Wmax and P w Wmin are the maximum and minimum power of wind farm w, μ W and μ L are penalty coefcients of wind abandonment and load shedding, and P w W (t) is the power of wind farm w at time interval t.
Adding BESS to the system increases the system's adjustable capacity and can reduce the risk of wind abandonment and load shedding [24,25].Te state of charge (SOC) of the BESS is maintained within an expected range to cope with the possible wind forecast error [26].Te risk cost function with reserve capacity of BESS is as follows: where V b c (t) and V b d (t) are charging and discharging reserve capacity of BESS b at time interval t.

Operation Cost of Termal Power Units.
Te power imbalance caused by the wind forecast error often requires the power of thermal power units to adjust, which will produce a certain fuel cost and operation cost, that is, the operation cost of thermal power units.
where ∆P g Gumax (t), ∆P g Gdmax (t), ∆P g Gu (t), and ∆P g Gd (t) are the maximum ramp up limit, the maximum ramp down limit, the ramp up power, and the ramp down power of the thermal power unit g at time interval t.C g is the fuel cost function of thermal power unit g, a g , b g , and c g are fuel cost coefcients of thermal power unit g, d g is the ramping cost coefcient of thermal power unit g.
where k 1 , k 2 , and k 3 are weight coefcients and ρ, C B , and E c are the load peak-valley ratio, BESS operation cost function, and carbon emission function of thermal power units.
Te equivalent load of the system is the sum of load power and BESS charging and discharging power.
where N K is number of nodes and P k K (t) is the load power on node k at time t.
Ten, the load peak-valley ratio of the equivalent load is as follows: Te operation cost of BESS is as follows: where c B,b is the operation cost coefcient of BESS b.

Objective Function in the Second
Stage.Te capacity of adjustable resources of the system is optimized in the second stage.Te reserve capacity of BESS and the ramping power of thermal power units are adjusted to minimize risk cost function with BESS, including the risk cost of wind power and operation cost of thermal power units. min

Constraints in the First Stage
(a) Power balance constraint is as follows: (b) Wind power constraint is as follows: (c) Termal power constraint is as follows: where P g G,min and P g Gmax are minimum and maximum power of thermal unit g.(d) Ramping constraint of thermal power units is as follows: (e) Start-stop constraints of thermal power units are as follows: where u g (j) represents the startup and shutdown status of the thermal unit g at time j, u g (j) � 0 represents shutdown and u g (j) � 1 represents startup, and T g,on and T g,off are the maximum continuous start and maximum continuous stop time of thermal unit g. (f ) BESS charge and discharge power constraints are as follows: where P b c max and P b d max are maximum charge and discharge power of BESS b.(g) State of charge constraints are as follows: where (b) BESS reserve capacity constraint is as follows: (c) SOC constraint with BESS reserve capacity is as follows: In order to ensure that the BESS can provide backup to cope with the risk of wind forecast error time t, the SOC constraint including the BESS reserve capacity is proposed as follows:

Solution of the Two-Stage Optimization Model.
Te solution process of the two-stage optimization model is to frst give initial values to the variables in the frst stage and then to optimize the model in the second stage.Te obtained results in the second stage are returned to the model of the frst stage, and the two models iterate alternately to fnally obtain the result.Te immune genetic algorithm [27] is used to solve the frst stage problem, and the CPLEX solver in MATLAB is used to solve the second stage problem.In this paper, the reserve capacity of BESS is optimized with the objective of minimizing the risk cost of wind power and the operation cost of thermal power units after the thermal power output and BESS charging and discharging power are determined.Terefore, this paper uses a two-stage optimization model to describe the BESS optimization problem.Te convergence condition is as follows: where V b c,i (t) and V b d,i (t) are charging and discharging reserve capacity of BESS b at iteration i, respectively, and ε is a positive number small enough.Te algorithm fowchart is shown in Figure 2.

Results and Discussion
5.1.Simulation Setup.IEEE30 node 6-machine systems are used to verify the model built in this paper.Te system includes six coal-fred thermal power units with the same capacity of 100 MW, a wind farm with a capacity of 200 MW, and an energy storage system with the capacity of 200 MW.Te maximum and minimum output power of the wind farm is 200 MW and 0, respectively.Parameters of thermal power units and BESS are given in Tables 1 and 2, and predicted data of load and wind power are given in Figure 3.According to the carbon emission intensity curves of actual coal-fred units under diferent load rates, the linear function between thermal power and carbon emission intensity is obtained through linear regression.

Comparison of Diferent Algorithms.
Te multiobjective algorithm for the two-stage model proposed in this paper is the immune genetic algorithm (IGA) [27].In order to show the superiority of IGA in solving the model, the calculation results of IGA and of the traditional genetic algorithm (GA) were compared under the same setting of relevant parameters.
Te simulation results of IGA, GA, and particle swarm optimization (PSO) are compared.Te crossover probability of GA is 0.9, and the mutation probability is 0.1.Te selflearning factor and social learning factor of the PSO are 2, with an initial inertia weight value of 0.9 and a maximum inertia weight value of 0.4.Te other parameters of the algorithm remain unchanged, and the simulation results are shown in Table 3. Te convergence curves of the algorithm are shown in Figure 4.

International Transactions on Electrical Energy Systems
It can be seen from the simulation results that in solving accuracy, the IGA can efectively overcome population precocity, enabling the algorithm to jump out of the local optimal solution and fnd a better solution.However, the IGA has limited ability to explore new spaces and is prone to convergence to the local optimal solution.Moreover, the algorithm belongs to the random algorithm, resulting in poor reliability and instability in obtaining the optimal solution.Terefore, the selection of algorithm parameters needs to refer to examples from existing references.

Comparison of Optimization Results
. In this paper, three cases are set for comparative analysis.Under the same system settings, the optimization results are shown in Table 4. Case 1 is the model in this paper; Case 2: the BESS does not participate in the optimization of reserve capacity in the second stage; and Case 3 is that the BESS participates in the optimization of reserve capacity, but the carbon emission measurement in the frst stage does not include the power of the BESS.
It can be seen from Table 4 that the system carbon emissions of cases 1 and case 2 are slightly lower than those of case 3. Te diference between the carbon emissions of case 1 and case 3 is the contribution of the BESS charging and discharging power to the system's carbon emissions.Te power of BESS is added to the carbon emission measurement model in case 1 to describe the real carbon emissions of the system.Diferent from case 3, the model proposed in this paper takes into account the contribution of the BESS, so that the BESS power needs to be as large as possible, thus reducing the reserve capacity and increasing the risk cost of wind power and load shedding risk cost.However, the large power of BESS can reduce the operation of thermal power units, that is, reducing the operation risk and cost of thermal power units.Terefore, case 1 still has the lowest total cost.
In Table 4, the carbon emission of case 2 is lower than that of case 1. Due to the uncertainty of wind power, the BESS reserve capacity may lead to the BESS not fully utilized, resulting in reserved redundancy.In case 2, because there is no BESS reserve capacity, the power of BESS is the largest, the BESS operation cost is the highest, the peak-valley diference rate is the smallest, and the risk of load shedding and wind abandonment and operation cost of thermal power units are the largest.
Figure 5 shows the SOC curves for three cases.Te optimization results of the BESS reserve capacity in case 1 and case 3 are shown in Figures 6 and 7.In cases 1 and 3, the BESS system needs to reserve a certain capacity, which leads to its conservative operation.At 1:00-7:00, the SOC of case 1 is smaller than that of case 2. Tis is because the wind power output is large, and case 1 reserves a certain amount of upper capacity, thus reducing the charging power in this period.During 12:00-20:00, the wind power output is small and the load power is large, so a certain lower capacity is reserved for BESS, which reduces the discharge power during this period.Case 3 is more extreme than case 2, with sufcient reserve capacity in all periods.Tis is because case 3 does not calculate the carbon emission benefts brought by BESS, so that BESS is almost used as a backup device.International Transactions on Electrical Energy Systems Te power of thermal units and BESS in 3 cases is shown in Figure 8. Case 1 is similar to case 2. In case 2, since the BESS does not participate in the backup, the charging and discharging power of the BESS is larger at all times.In case 3, since the carbon emission benefts brought by the BESS are not calculated, the BESS is almost used as a backup, and the output of thermal power units needs to be adjusted to maintain power balance, resulting in the highest operation cost of thermal power units and the largest system carbon emissions.However, in case 3, since BESS is used as backup equipment, the risk cost of wind power is the lowest.

Comparison of Carbon Emission Models.
In this paper, the carbon emission intensity of thermal power units is negatively related to the load, that is, the higher the load, the lower the carbon emission intensity, as shown in Figure 9.It can be seen from Table 5 that the model with a fxed carbon emission intensity overestimates the carbon emissions of thermal power units.
In this carbon emission model, when the value of ω t � r × min(I g (P g G (t))) in the model increases from 0.1 × min(I g (P g G (t))) to 1 × min(I g (P g G (t))), the BESS charging and discharging power will be slightly increased, and the power of thermal units will be slightly reduced, which will reduce the total carbon emissions of the system.When ω t > min(I g (P g G (t))), the model will have no solution.Te case 3 in this paper is when ω t � 0.
Figures 10 and 11 show the power of the BESS and thermal units when t � 13 under diferent values of ω t , and the BESS is in the discharge state at this time interval.With    International Transactions on Electrical Energy Systems the increase of the value of ω t , the BESS discharge power increases linearly, and the power of the thermal units decreases linearly, so the increase of the BESS discharge power is equal to the decrease of the power of the thermal units.Tis is because the larger the value of ω t is, the greater the carbon emission intensity of the BESS is.In order to minimize the objective function E c , when the load is a fxed value, the BESS discharge power will increase and the power of thermal units will be reduced accordingly.Similarly, when the BESS is charging, the greater the ω t is, the greater the BESS charging power is, and the power of thermal units will also increase accordingly.However, the increase in the power of thermal units will reduce its carbon emission intensity, so the objective function E c can still be optimal.By increasing the value of ω t , the carbon emission intensity of the BESS can be increased, making the BESS operation strategy more radical.

Conclusion
Tis paper includes the negative correlation between the carbon emission intensity of thermal power units and the load into the carbon emission measurement model, which improves the accuracy of carbon emission measurement of thermal power units.Te system carbon emissions reduced by BESS are included in the carbon emission measurement, and it is proposed that the carbon emission intensity of BESS is related to the carbon emission intensity of thermal power units.Setting different values of ω t can change the power of BESS and thermal units.Te larger the ω t , the greater the power of BESS, the lower the power of the thermal units, and the lower the carbon emissions of the system.
Te risk cost of wind power is described by the distribution of wind forecast error, and the risk cost function of wind power with BESS reserve capacity is proposed in this paper.When the grid-side BESS has maximum reserve capacity, the risk cost of wind power can be signifcantly reduced, that is, the risk of load shedding and wind abandonment, and the operation cost of thermal power units can be reduced.
In the two-stage optimization model, the objective function in the frst stage model is to minimize carbon emissions and load peak-valley diference by the operation of BESS, and the objective function in the second stage model is to minimize the system operation cost with the maximum reserve capacity of BESS.Te frst stage decision variables and the second stage decision variables restrict each other, providing an operation strategy of low carbon and fexible peak shaving for BESS.

6Figure 2 :
Figure 2: Te algorithm fowchart of the two-stage operation model iteration process.

Figure 3 :
Figure 3: Predicted data of load and wind power.

Figure 5 :
Figure 5: Te optimization results of the SOC in diferent cases.

Figure 6 :
Figure 6: Case 1: BESS optimization results at all time intervals.

Figure 9 :
Figure 9: Carbon emission intensity of thermal power units.

Stage Optimization Model of Grid-Side BESS with Maximum Reserve Capacity and Minimum Carbon Emission
S b (t) is state of charge of BESS b at time interval t, S b,max and S b,min are upper and lower limits of state of charge, σ b is the self-discharge rate, and η b c and η b d are the charge and discharge efciency.4.2.2.Constraints in the Second Stage.After satisfying the constraints in the frst stage, the variables to be solved in the second stage shall meet the following constraints:

Table 3 :
Performance comparison of diferent algorithms.

Table 4 :
Comparison of optimization results of diferent cases.

Table 5 :
Comparison of system carbon emissions.Figure 10: Variation curve of the power of BESS at diferent ω t values.Figure 11: Variation curve of the power of thermal units at different ω t values., b g , c g : Fuel cost coefcients of thermal power units d g : Ramping cost coefcient of thermal power units k 1 , k 2 , k 3 : Weight coefcients of objective functions c B,b : Time between two consecutive time steps, in this paper, ∆t � 1 hour T: Number of time intervals in one day, T � 24.