Using Battery Storage for Peak Shaving and Frequency Regulation: Joint Optimization for Superlinear Gains
Yuanyuan Shi Bolun Xu Di Wang Baosen Zhang



Cosmological evolution of primordial black holes
    Bing Zhang
    December 30, 2023
================================================



We consider using a battery storage system simultaneously for peak shaving and frequency regulation through a joint optimization framework which captures battery degradation, operational constraints and uncertainties in customer load and regulation signals. Under this framework, using real data we show the electricity bill of users can be reduced by up to 12%. Furthermore, we demonstrate that the saving from joint optimization is often larger than the sum of the optimal savings when the battery is used for the two individual applications. A simple threshold real-time algorithm is proposed and achieves this superlinear gain. Compared to prior works that focused on using battery storage systems for single applications, our results suggest that batteries can achieve much larger economic benefits than previously thought if they jointly provide multiple services.




Battery management system, frequency regulation service, power system economics, data centers




§ INTRODUCTION



Battery energy storage systems are becoming increasingly important in power system operations. As the penetration of uncertain and intermittent renewable resources increase, storage systems are critical to the robustness, resiliency, and efficiency of energy systems. For example, studies suggest that 22 GW of energy storage would be needed in California by 2050 <cit.> and the entire United States could require 152 GW of storage <cit.>. Much of these capacities are expected to be achieved by distributed storage systems owned by individual consumers <cit.>.

Currently, the two most prominent types of consumers that own significant levels of storage are information technology companies and operators of large buildings. Companies such as Microsoft and Google use battery storages extensively in their data centers as failover to onsite local generation <cit.>. These systems are sized to the capacity of the data center: a 10 MW data center will have a storage system with the power rating of 10 MW with several minutes of energy capacity. In commercial buildings, batteries are used to smooth their load and provide backup services <cit.>. These batteries tend to be slightly smaller, but are still in the 100's of kW/kWh range.

Today, despite their potential to grid services, these battery storage systems are not integrated with the power system. To a storage owner, whether a battery taking part in grid services is predominantly determined by the economic benefits of these services. For example, a data center replaces its batteries every four years or so under normal conditions <cit.>. If the battery participates in the electricity market, batteries may degrade faster and require more frequent replacements. Do the gains from the market justify the additional operational and capital costs?

The question of optimally operating a battery to maximize its economic benefit is a central one and has spurred a substantial body of research. The problems include energy arbitrage, peak shaving, frequency regulation, demand response and others (e.g. see <cit.> and the references within). In the past several years, it has been recognized that because of the high capital cost of batteries <cit.>, serving a single application is often difficult to justify their investments <cit.>. In addition, picking a single application does not consider the possibility of multiple revenue streams and may leave “money on the table”.
Consequently, a recent line of research has started to analyze the co-optimization of batteries for both energy arbitrage and regulation services <cit.>.


In this paper, we consider the joint optimization of using a battery storage system for both peak shaving and frequency regulation for a commercial customer. Peak shaving can be used to reduce the peak demand charge for these customers and the (fast) frequency regulation is an ideal service to provide for batteries because of their near instantaneous response time. The challenge in combining these two applications lies in their vastly different timescales: peak demand charge is calculated every month on a smoothed power consumption profile (e.g. 15-minute averages), while fast frequency regulation requires a decision every 2 to 4 seconds. 

The key observation in our work is that serving different applications over different timescales is economically beneficial to the battery: by exploring the diversity in different applications, we can obtain a so-called superlinear gain. An example of the superlinear gain is presented in Fig. 1. It gives the annual electricity bill savings for a 1MW data center under three scenarios, using batteries for frequency regulation service, peak shaving and joint optimization. For joint optimization, we use a simple online threshold algorithm given in Section IV. While for peak shaving and regulation service, the solutions are offline optimal. The super-linear gain arises for reasons that would be explored in depth in the rest of the paper, but briefly speaking, the randomness of frequency regulation signal could contribute to more efficient peak shaving. By exploring the diversity and mutual benefit in different applications, we have this non-linear behavior.

It should be noted that the key function of the existing batteries in data centers is to provide backup capacity. The proposed joint optimization framework is deploying only part of the battery energy capacity while a large portion of the battery energy has been reserved for backup purpose. A more detailed discussion on the division of battery for grid service and backup is provided in Section V-A.



 §.§ Literature Review

The line of literatures consider co-optimization of storage starts from <cit.>. In <cit.>, the authors analyze the economics of using storage device for both energy arbitrage and frequency regulation service. The work in <cit.> extended this “dual-use” idea by considering plug-in electric vehicles as grid storage resource for peak shaving and frequency regulation. Both works showed that dual-use of storage often leads to higher profits than single applications. However, the aforementioned works mainly rely on heuristic analysis under different price and user patterns without directly using optimization models. The work of <cit.> bridged the methodology gap by proposing a systematic co-optimization framework, which could be applied for evaluating different application combinations at different timescales. This framework assumes that all future information is known, so it cannot be extended directly to deal with potential uncertainties from energy and ancillary service markets (e.g., price, frequency regulation signal, etc.).

To deal with uncertainties, <cit.> formulate the battery co-optimization problem as a stochastic program. In <cit.>, stochastic programming was solved to obtain hourly optimal decisions. The work in <cit.> included applications of different time-scales in its optimization and tackled computational challenges by taking advantage of the problem's nested structure.



 §.§ Our Contributions

Our work is close in spirit to <cit.>, which captures both the future market uncertainties and timescale difference of multiple applications. However, compared with <cit.>, our work contributes in two significant ways:

    
  * We propose a joint optimization framework for batteries to perform peak shaving and provide frequency regulation services. This framework accounts for battery degradation, operational constraints, and the uncertainties in both the customer load and regulation signals. All of the previous works, to our knowledge, do not include the operational cost of batteries in their optimization models, which can potentially lead to aggressive charging/discharging responses and severely suboptimal operations <cit.>. Since batteries cycle multiple times a day when used for frequency regulation and peak shaving, the degradation effect plays an important role in determining their operations.
    
  * We show that there is a superlinear gain: where the revenue from joint optimization is larger than the sum of performing the individual applications. We quantify this gain using real world data from two large commercial users: a Microsoft data center and the University of Washington EE & CSE building. Figure <ref> gives an example daily load profile for both cases. The superlinear gain is fundamentally different from previous observations in <cit.> which only compared the revenue from co-optimization with one single application rather than the sum of the applications. The results in <cit.> hinted at the relationship between co-optimization revenue and the sum of multiple revenue streams, while mainly focusing on the trade-off between different applications and their “subadditivity”. The key observation in our work is that batteries can achieve much larger economic benefits than previously thought if they jointly provide multiple services by exploring the diversity of different applications.




The rest of the paper is organized as follows. Section <ref> provides some background on electricity market rules and battery cell degradation. Section <ref> gives the joint optimization formulation. In Section <ref>, we propose a simple threshold control algorithm which achieves the superlinear gain in real time. Section <ref> analyzes the superlinear benefits using both real data and synthetic data. Finally, Section <ref> concludes the paper and outlines directions for future work.




§ PROBLEM FORMULATION






This section provides some basic definitions and the detailed model setup.  We consider a finite time horizon partitioned into T discrete intervals, indexed by t ∈{1,2,...,T}.

This section sets up the overall optimization problem in three steps. First, we explain how the electricity bill is calculated for a large commercial user. Then we focus on two potential applications of using batteries: peak shaving and frequency regulation. Then we introduce the battery degradation model considered in this paper.













































 §.§ Electricity Bill of Commercial Users

We consider commercial consumers whose electricity bill consists of two parts: energy charge and peak demand charge. Let s(t) be the power consumption at at t and t_s be the size of a time step. Then the energy charge is given by:

    J^elec = λ_elec∑_t=1^T s(t) · t_s,

where λ_elec is the price of energy with a unit of $/MWh. The peak demand charge is based on the maximum power consumption. In practice, this charge is calculated from a running average of power consumption over 15 or 30 minutes. Let s̅(t) denote the smoothed demand and then the peak demand charge can be written as,

    J^peak = λ_peakmax_t = 1,2,...,T [s̅(t)].

For the rest of the paper, the time step size t_s is absorbed into the price coefficients for simplicity. Hence, the total electricity bill for a commercial user over time T is,

    J=λ_elec∑_t=1^T s(t)+ λ_peakmax_t = 1,2,...,T [s̅(t))] ,

This cost function is convex in s(t) since it is a linear combination of linear functions and a piece-wise max function. In this paper, we investigate how to reduce the total cost (<ref>) by using battery energy storage (BES). Specifically, we consider two applications, peak shaving and frequency regulation.




 §.§ Peak Shaving

The peak demand charge of commercial users could be as large as their energy cost. Therefore smoothing or flattening peak demand represents an important method of reducing their electrical bills. A myriad of methods for peak shaving have been proposed in the literature, e.g., using energy storage <cit.>, load shifting and balancing <cit.>. Here we focus on using batteries. Batteries can discharge energy when demand is high and charge in other times to smooth user's consumption profiles. Let b(t) denote the power injected by the battery, with the convention that b(t)>0 represents discharging and b(t)<0 represents charging. Then s(t)-b(t) is the actual power draw from the grid. Let b=[b(1)  …  b(T)] be the vector of battery actions. The total electricity bill becomes

    J^P   = λ_elec∑_t=1^T[s(t)-b(t)] + f( b) 
        + λ_peakt=1...Tmax[(s̅(t)-b̅(t))]

where  b̅(t) is the averaged power injection of the battery and f( b) models the degradation effect of using the battery. We note that battery degradation costs maybe somewhat complicated functions of the entire profile. More details about the battery cost model will be introduced in Section <ref>.



 §.§ Frequency Regulation Service

Besides doing peak shaving, commercial users could earn revenue by providing grid services. In this paper, we consider using batteries owned by these users to participate in the frequency regulation market. In particular, we adopt a simplified version of the PJM frequency regulation market <cit.>. Fig. <ref> gives an example of the PJM fast frequency regulation (RegD) signal for 2 hours. Compared with traditional frequency regulation signals, it has a much faster ramping rate and is designed to have a zero-mean within a certain time interval, which is well aligned with the characteristics of batteries.


For providing frequency regulation service, the grid operator pays a per-MW option fee λ_c to a resource with stand-by power capacity C for each hour. While during the frequency regulation procurement period, the resource is subjected to a per-MWh regulation mismatch penalty (λ_mis) for the absolute error between the instructed dispatch and the resource's actual response. Let r(t) be the normalized RegD signal, and the revenue from providing frequency regulation service over time T is:

    R = λ_c C · T - λ_mis∑_t=1^T|b(t)-Cr(t)| - f( b),

where f( b) is again the operating cost of the battery.



 §.§ Battery Cell Degradation
 
A key factor in the operational planning of battery energy storage (BES) is its operating cost, a majority of which stems from the degradation of battery cells subjected to repeated charge/discharge cycles. Different batteries exhibit different degradation behaviors, and their understanding and characterization is a major area of study (see <cit.> and references within). In this paper, we focus on lithium-ion batteries, which are one of the most popular batteries used in practice today.

Modeling battery degradation is a challenging task and no single model can be used for all types of chemistry. We do not attempt to propose a single detailed model in this paper; instead, some general features of battery degradation are captured and included in our optimization framework.
  
 

 For instance, the authors in <cit.> showed that the capacity of the Lithium Manganese Oxide (LMO) batteries are sensitive to both the number of cycles as well as the cycle depth of discharge (DoD). The data in Fig. <ref> comes from a LMO cycle life test data in <cit.>. It shows that, if we limit the battery operation within certain DoD region to avoid the overcharge and over-discharge effects, there is a constant marginal cost for the cycle depth increase. In addition, cycle DoD is a linear function of the amount of battery charging/discharging,

    DoD = ∑_t∈ T_i b(t)t_s,

where T_i denotes a set of timesteps belongs to the same battery degradation cycle. Thus, we could assign a constant marginal cost for the amount of battery charging/discharging:
    
f( b) ∝λ_b |b(t)|,
where λ_b is the linearized battery degradation cost co-efficient. To get λ_b, we normalize battery lifetime into the amount of energy a battery cell can process before reaching end-of-life, and prorate the battery cell cost into a per-MWh cost with respect to the charged and discharged energy.

    λ_b = λ_cell· 10^6/2N · (SoC_max - SoC_min)

In the above formula, λ_cell is the battery cell price ($/Wh), N is the number of cycles that the battery could be operated within SoC limit [SoC_min, SoC_max].

For Lithium-ion batteries based on other chemistries such as lithium iron phosphate (LiFePO_4), the loss of life per cycle is interpreted as a function of cycle numbers rather than the amount of energy charged or discharged <cit.>.


This type of degradation model works well for long timescale applications considered in <cit.>. However, we consider battery for fast frequency regulation service, where the direction of b(t) changes fairly quickly. If one interprets the degradation cost as a function of the charging/discharging direction change times, the model would be too aggressive. In fact, this model suggests that a battery may die in a matter of days. Therefore, we adopt a cost that is proportional to the battery power. We limit the battery operation within certain DoD range (70%), and assign a constant marginal cost for battery energy charging and discharging.










§ JOINT OPTIMIZATION FRAMEWORK






 §.§ The Joint Optimization Model

In this paper, we consider using a battery to provide frequency regulation service and peak shaving simultaneously, thus to boost the economic benefits. The stochastic joint optimization problem is given in (<ref>), which captures both the uncertainty of future demand s(t) and the uncertainty of future frequency regulation signals r(t).


 
 	
    J^joint =    min_C, b^ch(t), b^dc(t), y(t) λ_elec∑_t=1^TE_ s[s(t)- b(t)]
        + λ_peakt=1...Tmax E_ s[s̅(̅t̅)̅-  b̅(̅t̅)̅]+∑_t=1^Tf(b(t))
       -E_ r,  s[λ_c T · C - λ_mis∑_t=1^T|-s(t)+ b(t)+y(t)-Cr(t)|] 
    s.t.     b(t) = b^dc(t)-b^ch(t) , 
        C ≥ 0 ,  
        SoC_min≤SoC_ini+ ∑_τ=1^t[b^ch(τ)η_c-b^dc(τ)/η_d]t_s/E≤SoC_max
        0 ≤ b^ch(t) ≤ P^max ,
        0 ≤ b^dc(t) ≤ P^max .

 


The objective function (<ref>) minimizes the total electricity cost of a commercial user for the next day, including the energy cost, peak demand charge, battery degradation cost and frequency regulation service revenue. The optimization variables are frequency regulation capacity C, battery charging/discharging power b^ch(t), b^dc(t) and frequency regulation load baseline y(t). Participants in frequency regulation market should report a baseline y(t) to the grid operator ahead of their service time <cit.>. For a commercial user, the baseline y(t) is its load forecasting. Constraint (<ref>) guarantees a non-negative frequency regulation capacity bidding. (<ref>), (<ref>) and (<ref>) represent the battery SoC limit and power limits.



 §.§ Benchmark

To show the gain of joint optimization, we describe two benchmark problems: the offline (deterministic) peak shaving problem and the offline (deterministic) frequency regulation service problem. In these benchmarks, we assume complete knowledge of the future. In essence, the benchmarks here represent the best possible performance of any algorithms that solve these problems individually.

The offline peak shaving problem is:


 	
    J^p = min_b(t)    λ_elec∑_t=1^T[s(t)-b(t)] + λ_peakt=1...Tmax[s̅(̅t̅)̅-b̅(̅t̅)̅] 
         +  ∑_t=1^T f(b(t)) 
    s.t.     b(t) = b^dc(t)-b^ch(t) , 
        SoC_min≤SoC_ini+ ∑_τ=1^t[b^ch(τ)η_c-b^dc(τ)/η_d]t_s/E≤SoC_max
        0 ≤ b^ch(t) ≤ P^max ,
        0 ≤ b^dc(t) ≤ P^max .




The above problem is convex in terms of b. We solve it and denote the optimal bill value as J^p. The offline frequency regulation problem is:


	
 	
    R^* = max_C, b(t)    λ_c T · C - λ_mis∑_t=1^T|b(t)-Cr(t)| - ∑_t=1^T f(b(t)) 
    s.t.     b(t) = b^dc(t)-b^ch(t) , 
        C ≥ 0  , 
        SoC_min≤SoC_ini+ ∑_τ=1^t[b^ch(τ)η_c-b^dc(τ)/η_d]t_s/E≤SoC_max
        0 ≤ b^ch(t) ≤ P^max ,
        0 ≤ b^dc(t) ≤ P^max .

 


The above regulation revenue maximization problem does not consider the effect of providing frequency regulation service on electricity bills. Recall that frequency regulation is a service managed by grid operators, while as an end consumer, the commercial user's electricity supply contracts with the utility is unchanged, thus the user still subjects to the energy and peak demand charge. Therefore, the overall electricity bill J^r is,

    J^r   = λ_elec∑_t=1^T[s(t)-b^r(t)]
        + λ_peakt=1...Tmax[s̅(̅t̅)̅-b̅^r(t)] -R^* ,

where b^r(t) is the optimal battery responce for frequency regulation service and R^* the optimal service revenue.

Both of the benchmark problems are convex because all of the constraints are linear and objectives are an addition of convex functions (pointwise maximum is a convex function). To solve these problems, we use the CVX package for Matlab <cit.>, a generic package for solving convex problems. We used a 2.5 GHz Intel Core i7 Macbook with 16 GB memory.  The problem size can be fairly large, since the time resolution is 4s. But even for an 8-hour horizon, the problem can be solved in about 10 minutes.



 §.§ The Superlinear Gain


Our results highlight that a superlinear gain can often be obtained: the saving from the stochastic joint optimization can be larger than the sum of two benchmark optima. In mathematical form, superlinear gain denotes the following phenomenon, which often holds in practice,

    J-J^joint > (J-J^r)+(J-J^p) ,

where the left side of Eq. (<ref>) is the saving from joint optimization, and the right side represents the sum of savings from two benchmark problems. The key observation in such case is the “super-additivity”. The revenue from co-optimization of multiple applications is not only higher than the revenue from any single application (which may be obvious), but also higher than the sum of revenues from all individual applications.

We provide an example to demonstrate the superlinear gain. Table <ref> gives the daily electricity bill under four scenarios for a 1MW data center: the original bill (batteries are left idle), using battery only for frequency regulation service, using battery only for peak shaving, and using battery for both services (detailed algorithm discussed in Section <ref>). The bill savings are highlighted, from which we observed that saving from joint optimization is larger than the sum of each individual applications. The load curve and frequency regulation signals for that day are given in Fig. 2a and Fig. <ref>.






§ ONLINE BATTERY CONTROL



The previous section demonstrates that battery joint optimization could have superlinear gains. In this section, we propose an online battery control algorithm for joint optimization. The challenge in combining peak shaving and frequency regulation service together lies in their vastly different timescales. To deal with the timescale difference, we divided the optimization problem into two stages, 1) day-ahead decision on peak shaving threshold and frequency regulation capacity bidding; 2)  real-time control of battery charging/discharging. Fig. <ref> summarizes the workflow of the overall control algorithm. In this section, we first introduce the load prediction and scenario reduction method for solving the day-ahead optimization problem, and then a real-time battery operation algorithm is presented.




 §.§ Load Prediction and Scenario Generation


We use a multiple linear regression (MLR) model <cit.> for day-ahead load prediction, which is simple, easy to implement in commercial user's site, yet achieves high prediction accuracy. Details of the load prediction algorithm are given in Appendix A. We used the 10-fold cross validation method to evaluate the MLR load prediction model, and the resulting mean absolute percentage error (MAPE) is 3.7% for Microsoft data center load and 2.3% for University of Washington EE & CSE building. MAPE is a measure of prediction accuracy, which is calculated by averaging the absolute deviation between real value and prediction divided by the actual value.

To deal with the uncertainty of future regulation signal, a scenario-based method is implemented. Here, we use one-year historical data to empirically model the distribution of regulation signals. Each daily realization of the regulation signal is called a “scenario”, and thus we obtain 365 scenarios. We applied the forward scenario reduction algorithm in <cit.> to select the best subset of scenarios. We set the number of selected scenarios as 10, which strives for a balance between performance and computational complexity by simulation results. Therefore, we have a set of 10 scenarios for frequency regulation signals denoted as Ω and each scenario associated with a realization probability ω_i, which in total compose the uncertainty set of frequency regulation signal.

We solve the stochastic problem in (<ref>) using the load prediction ŝ(t) and contructed regulation signal uncertainty sets Ω. Define the optimal battery response and frequency regulation capacity as b^*(t) and C^*, then the optimal peak shaving threshold U^* is,

    U^* = t=1...Tmax[ŝ(t)-b̅^*(t)] ,





 §.§ Real-time Control for Battery Charging/Discharging


Section <ref> describes how to make day-ahead decisions on capacity bidding and peak threshold. Here we introduce a simple real-time battery control algorithm for joint optimization. It is computationally efficient, which only requires the measurement of battery's real-time state of charge (SoC) and achieves near-optimal performance compared with the offline optima with perfect foresight. Although more sophisticated methods such as model predictive control <cit.> or dynamic programming <cit.> have been proposed in the previous literature, they are not needed in this case given the near-optimal performance and high computational efficiency of the proposed online control method. 

The intuition for the real-time joint optimization control algorithm comes from the optimal battery control algorithm for frequency regulation service. Recall the benchmark frequency regulation problem with objective (<ref>): under linear battery cost model, given a fixed capacity bidding C, we have a simple yet optimal real-time battery control method. Theorem <ref> describes the optimal control algorithm for batteries providing frequency regulation service.


	Assume λ_b < λ_mis.[Otherwise the battery would not be used at all.] If the marginal battery charging/discharging cost is constant within the operation region, that is, f(b(t)) = λ_b |b(t)|. For a given capacity C, the optimal battery response b^*(t) for providing frequency regulation service is:

	
  * min{Cr(t), P^max, η_d [soc(t)-SoC_min]E/t_s}, if r(t)≥ 0
	

	
  * max{Cr(t),-P^max ,[SoC(t)-SoC_max] E/η_c t_s},  if r(t) < 0

where SoC(t) of the battery state of charge at the beginning of time step t.
	
	
	
	
	
	
	

	
	


The proof of Theorem <ref> is given in the Appendix C. As the theorem shows, when the marginal operation cost for battery charging/discharging is constant, the optimal battery control policy is a simple threshold policy. Following Theorem <ref>, we propose a real-time control algorithm for joint optimization in Algorithm <ref>.

Table <ref> gives a comprehensive comparison between the simple online control algorithm and the offline optima with perfect foresight based on half year of simulation results of Microsoft data center and one-year data of UW EE & CSE building. Both results show that by implementing the simple threshold algorithm, we can achieve near-optimal performance compared with the perfect foresight case.





§ SIMULATION RESULTS



We provide a case study using half year power consumption data from Microsoft data center and one year data from University of Washington EE & CSE building. The frequency regulation signal is from PJM fast frequency regulation market<cit.>, where the considered Microsoft data center locates. We implement the simple threshold control algorithm in Section <ref> for battery joint optimization. Simulation results demonstrate that over 80% of time, we will have the superlinear benefits by joint optimization.


 §.§ Parameter Setup

Assume that the battery optimization horizon is 1 day and the time granularity of t is 4s, so that T=4320. The electricity price is 47 $/MWh and peak demand charge is 12 $/kW per month. For frequency regulation service, suppose the capacity payment is 50$/MWh and set mismatch penalty to guarantee at least 80% performance score <cit.>. The BES for optimization is Lithium Manganese Oxide (LMO) battery, with high power capacity and low energy capacity. Within the SoC operation region SoC_min = 0.2 and SoC_max = 0.8, LMO battery has a constant marginal degradation cost with regard to how much energy is charged and discharged.

In this work, we consider using existing batteries in commercial users, e.g., the backup batteries in data centers, to participate in power market and reduce users' electricity bills. The key function of these batteries for users is to provide backup capabilities and the proposed joint optimization framework is deploying only part of the battery energy capacity. We assume the overall battery has a 1MW power capacity and 15 minutes energy capacity, which is a typical size of an industrial-scale grid-tied battery. Then, different portions of the total energy capacity are considered for grid service, 3 minutes, 5 minutes and 10 minutes respectively. The results are presented in Table <ref>, where the metrics for comparison under different scenarios are the annual bill savings and battery life expectancy.

An aggressive user may try to replace their battery in a yearly basis for the largest bill reduction. More likely, for a building or a data center, a 3 year cycle is preferred. In fact, most data centers already replace their batteries every 3 to 4 years for reliability reasons <cit.>, so using 3 minutes of the battery capacity for grid services would lead to considerable gains without any additional burdens. Of course, the remaining portion of battery energy storage is reserved for emergency backup.

Therefore we assume for joint optimization usage, the battery power rating P^max is 1MW, energy capacity E is 3 minute,  and battery cell price is 0.5 $/Wh. Accoring to Fig. <ref>, the LMO battery can be operated for N = 10,000 cycles when the average cycle DoD is 60%. Using Eq. (<ref>), we calculate the battery degradation cost as 83$/MWh.

In order to evaluate the performance of the proposed battery joint optimization algorithm, we compare the savings from joint optimization with the sum of savings from benchmark peak shaving and frequency regulation service. A criteria q (joint optimization saving ratio) is defined as below,

    q = (J-J^joint)-[(J-J^r)+(J-J^p)]/J ,

which describes the percentile of superlinear saving compared to the original bill.




 §.§ Results for Synthetic Load: Peak Shape and Superlinear Gain

In the previous sections (Figure 1 and Table II), we observed that by doing battery joint optimization, we have the superlinear gain. One natural question may come up, why we have the superlinear gain? Before we dive into more simulations on real data, we pick a simple rectangle peak where the base load is 0.5 MW, peak load is 1MW in this section for analysis, in order to better understand the conditions that lead to superlinear gains. We change the duration of peak from 3 minutes (a sharp peak) to 15 minutes (a flat peak) in order to study the effect of peak shape on the probability of superlinear gain.



Intuitively, the superlinear gain is related to the shape of demand curve. Consider two different peaks, a narrow peak (Fig. <ref>) and a wide peak (Fig. <ref>), we find that the main difference lies in the peak shaving part. For a 3 minute short-time peak, the battery could shave a large portion of the peak before hitting the SoC bound (Fig.<ref> (b)). Thus, we save a lot from only doing peak shaving and the two applications do not interact much , and there is no superlinear saving. However, when the peak duration is long, it takes more battery energy to shave the same height off the peak. As seen from Fig.<ref> (b), the battery doesn't respond much in the peak shaving only case because the cost of using battery gets close (or even exceeds) the saving from reduced peak demand charge. This argument is verified by Fig.<ref> (d), where we find only doing peak shaving does not reduce the bill much. But if we consider joint optimization, the randomness of regulation signal helps break down the one flat peak into several short-time peaks, and we could save more from doing peak shaving on top of providing regulation service. This is where the superlinear saving comes from.



 §.§ Results for Real-life Data: Microsoft Data Center and UW EE & CSE Building

This section conducts simulations based on real-life data from Microsoft data center and UW EE & CSE building. Table <ref> and <ref> summarize the simulation results. We consider using a 1MW, 3 minutes battery for grid service, and the reported numerical results are achieved by the implementing the proposed simple online control algorithm. For a 1MW data center with $488,370 annual electricity bill, the cost saving by joint optimization is around $52,282 (10.72%), with $13,234 extra saving compared with the sum of benchmark optima. For UW EE & CSE building, 362 out of the 365 days, we have the superlinear gain. The annual electricity bill for UW EE & CSE building is around $359,634, from which we save $44,420 (12.35%) by implementing battery joint optimization. The superlinear gain is $14,061 per year.



 To link the analysis of synthetic load in the previous section to the real-life cases of data center and UW EE & CSE building, we preform a statistical analysis of peak durations. We plot the Cumulative Distribution Function (CDF) of peak duration for the data center and UW EE & CSE building in Fig. <ref>, where the average peak duration for data center is 0.75h (about 45 minutes) and 8.33h for the building.
 

According to the observations in Figures 6 and 7, the proposed battery joint optimization has a larger gain for flat peaks compared to sharp peaks. Since the randomness of regulation signal helps break down one flat peak into several short-time peaks, we could save more from doing peak shaving on top of providing frequency regulation service. The exact definition of “long” and “short” peaks depend on the size of the battery. For a 3 minute battery, if the peak is shorter than 3 minutes, then performing joint optimization is not critical and we do not have a superlinear gain. On the other hand, for a peak that is longer than 3 minutes, it is important to use the regulation signal to break it up into smaller peaks. Therefore, both case studies have high superlinear gain probability, which is greater than 80%. The superlinear gain ratio of UW building (99%) is higher than the ratio of the data center (82.5%) since there are virtually no peaks shorter than the battery capacity in the former and a still a few short peaks in the latter.



 §.§ Sensitivity Analysis

Here, we preform sensitivity analysis about how different price settings, including different demand charge prices λ_peak, battery degradation costs λ_b and regulation payments λ_c, influence the superlinear gain ratio. In order to quantatively evaluate the conditions when superlinear gain will happen and generalize the analysis to all potential scenarios, we pick a simple load curve with a rectangle peak (base load 0.5 MW, peak load is 1 MW, peak duration 15 minutes) and a truncated Gaussian signal as frequency regulation signal, with μ = 0, σ^2 = 0.12 (variance of the PJM RegD signal) and range [-1,1]. The simple rectangle peak and synthetic frequency regulation signal are given in Fig. <ref>.


Fig. 10a shows how the chance of having superlinear gain changes with regard to battery cell price and peak demand charge. The probability of superlinear gain increases as the battery cell price goes down, or as the peak demand charge goes up. The “physical origin” of the superlinear gain is the positive interaction between peak shaving and frequency regulation service. Since the randomness in the frequency regulation signal breaks the flat peak into several smaller peaks, more savings are obtained by performing peak shaving on the top of frequency regulation. Therefore, as the peak demand price goes up, it yields more economic benefits to jointly optimize the two applications. Similarly, the as the battery prices decreases, it can be used more aggressively for both applications. As battery prices continue to decrease in the future, the benefits of joint optimization will increase.

Fig. 10b demonstrates how the probability of having superlinear relates to battery cell price and regulation capacity payment. The chance of having superlinear gain is the highest when both the battery cell price and regulation capacity payment are low. When the capacity payment is high enough, it yields much more economic benefits to provide frequency regulation service than peak shaving. In such condition, the  probability of having superlinear gain decreases.





§ CONCLUSION


This paper addresses using battery storage in large commercial users to reduce their electricity bills. We consider two sources of cost savings: reducing the peak demand charge and gaining revenue from participating in frequency regulation market. We formulate a framework that jointly optimizes battery usage for both of these applications. Surprisingly, we observe that a superlinear gain can often be obtained: the savings from joint optimization can be larger than the sum of the individual savings from devoting the battery to one of the applications. We also developed an online control algorithm which achieves the superlinear gain. The battery degradation model presented in this paper is in simplified linear form, which applies to certain battery operation range. Incorporating a more general and accurate battery degradation model, such as cycle-based degradation model <cit.> into the joint optimization framework might be an interesting direction for future work.








§ COMMERTIAL USER'S LOAD PREDICTION


Solving the stochastic joint optimization problem in (<ref>) requires accurate short-term load forecasting (STLF) for the next 24 hours. A lot of research has been done in the area of STLF. There are two major factors determine the quality of load prediction, input features and prediction model. On the one hand, selecting features or a group of features which affect the future load most is important. The input features mainly include the effect of nature (eg. temperature) and the effects of human activities (calendar variables, e.g., business hours), and the interaction of above two factors. On the other hand, deciding which kind of models to forecast future load is also crucial. People have been adopting or developing various techniques for day-ahead load forecasting, including regression, time series analysis, neural networks, support vector machine and a combination of the above methods (see <cit.> and references within).

In this paper, we used a multiple linear regression (MLR) model that takes 𝒳={trend, temperature forecasting (TMP), month, Hour × TMP, month × TMP, day × Hour, adjacency day's load, weekend and holiday effect, recent similar days' average} as input, and use the following MLR model to predict the power demand for next 1 day. Fig <ref> presents the day-ahead load prediction result for a data center.


    Y     = β_0 + β_1 × Trend + β_2 × TMP + β_3 × Month 
        +β_4 × Hour × TMP + β_5 × month × TMP 
        + β_6 × day × Hour + β_7 × Load(day-1) 
        + β_8 × weekend +β_9 × holiday + β_10×L̅o̅a̅d̅(day-1)






§ FREQUENCY REGULATION SIGNAL SCENARIOS REDUCTION


In order to solve the stochastic joint optimization problem in (<ref>), we also need to model the uncertainty of future regulation signals. In this paper, we use one-year historical data to empirically model the distributions of regulation signals. Each daily realization of the regulation signal is called a “scenario”, and thus we obtain 365 scenarios.

Because a large number of scenarios will reduce the computational tractability of the joint optimization problem, it is useful to choose a smaller subset of scenarios that can well approximate the original entire scenario set. We applied the forward scenario reduction algorithm in <cit.> to select the best subset of scenarios, and assign new probabilities to the selected scenarios. The key idea of scenario reduction is to pick a subset of scenarios which preserve as much information as the original set. We set the number of selected scenarios as 10, which strives for a balance between performance and computational complexity by simulation. For visualization clarity, we plot 4 out of the 10 selected scenarios in Fig. <ref>.





§ PROOF OF THEOREM 1


Here we provide a detailed proof of Theorem 1 in <ref>.

	Under linear battery cost model, it is obvious that b^*(t) and r(t) always have the same sign. Or equivalent saying,  b(t) and r(t) are always both positive or both negative. Based on the relative sizes of coefficients and sign, there are 5 cases to be considered:
	
    λ_b < λ_mis
    	r(t) ≥ 0
    	
    	b(t) ≥ Cr(t)  (i)
    
    	b(t) < Cr(t)  (ii)
    	
    
    	r(t) <0
    	
    	b(t) ≥ Cr(t)  (iii)
    
    	b(t) < Cr(t)  (iv)
    	
    
    λ_b ≥λ_mis (v)


	(i). λ_b < λ_mis, r(t) ≥ 0 and b(t) ≥ Cr(t)

	In this case, b(t) ≥ 0, battery is discharging. And the objective function (<ref>) becomes,

	
    C,b(t)maximize  λ_c C + 1/TE {-(λ_mis+λ_b)∑_t=1^Tb(t)+λ_mis∑_t=1^T Cr(t)}
 ,

	Notice that the coefficient in front of b(t) is negative. In order to maximize the objective, we need to minimize b(t) under the following constraints:
	
    b(t) ≥ 0
    
    	b(t) ≥ Cr(t) 
    
    	b(t) ≤ P^max
    
    	b(t) ≤η_d [soc(t)-SoC_min]E/t_s


	
		
  * If either Cr(t) > P^max or Cr(t) > η_d [soc(t)-SoC_min]E/t_s, there is no feasible solution for b(t).

		
  * If Cr(t) ≤ P^max and Cr(t) ≤η_d [soc(t)-SoC_min]E/t_s, we have the optimal b^*(t)=Cr(t).
	

	(ii). λ_b < λ_mis, r(t) ≥ 0 and b(t) < Cr(t)

	In this case, b(t) ≥ 0, battery is discharging, and the objective function (<ref>) becomes,

	
    C,b(t)maximize  λ_c C + 1/TE {(λ_mis-λ_b)∑_t=1^Tb(t)-λ_mis∑_t=1^T Cr(t)}
 ,

	Notice the coefficient in front of b(t) is (λ_mis-λ_b), which is positive in this case. So in order to maximize the objective, we need to maximize b(t) under the following constraints:
	
    b(t) ≥ 0
    
    	b(t) < Cr(t) 
    
    	b(t) ≤ P^max
    
    	b(t) ≤η_d [soc(t)-SoC_min]E/t_s


	So b^*(t) = min{Cr(t),P^max, η_d [soc(t)-SoC_min]E/t_s}.

	Summarizing case (i, ii), we get if λ_b < λ_mis, r(t) ≥ 0
	
    b^*(t) = min{Cr(t),P^max, η_d [soc(t)-SoC_min]E/t_s} .


	(iii). λ_b < λ_mis, r(t) < 0 and b(t) ≥ Cr(t)

	In this case, b(t) < 0, battery is charging, and the objective function (<ref>) becomes,

	
    C,b(t)maximize  λ_c C + 1/TE {(-λ_mis+λ_b)∑_t=1^Tb(t)+λ_mis∑_t=1^T Cr(t)}
 ,

	The coefficient in front of b(t) is (-λ_mis+λ_b), which is negative. So in order to maximize the objective, we need to minimize b(t) under the following constraints:
	
    b(t) ≤ 0
    
    	b(t) ≥ Cr(t) 
    
    	b(t) ≥ -P^max
    
    	b(t) ≥[SoC(t)-SoC_max] E/η_c t_s


	The minimal b(t) is optimal, b^*(t) = max{Cr(t),-P^max, [SoC(t)-SoC_max] E/η_c t_s}.

	(iv). λ_b < λ_mis, r(t) < 0 and b(t) < Cr(t)

	In this case, b(t) < 0, battery is charging, and the objective function (<ref>) becomes,

	
    C,b(t)maximize  λ_c C + 1/TE {(λ_mis+λ_b)∑_t=1^Tb(t)-λ_mis∑_t=1^T Cr(t)}
 ,

	The coefficient in front of b(t) is positive, so in order to maximize the objective, we need to maximize b(t) under the following constraints:
	
    b(t) < 0
    
    	b(t) < Cr(t) 
    
    	b(t) ≥ -P^max
    
    	b(t) ≥[SoC(t)-SoC_max] E/η_c t_s


	
		
  * If either Cr(t) <  -P^max or Cr(t) < [SoC(t)-SoC_max] E/η_c t_s, there is no feasible solution for b(t).

		
  * If Cr(t) ≥ -P^max and Cr(t) ≥[SoC(t)-SoC_max] E/η_c t_s, we have the optimal b^*(t)=Cr(t).
	

	Summarizing case (iii, iv), we get if λ_b < λ_mis, r(t) < 0,
	
    b^*(t) = max{Cr(t),-P^max, [SoC(t)-SoC_max] E/η_c t_s} .


	(v). λ_b ≥λ_mis

	We know that b(t) and r(t) always have the same sign, so the objective function   (<ref>) could be expressed as,

	
    λ_c · C - 1/T E{∑_t=1^Tλ_mis ||b(t)|-C|r(t)|| + ∑_t=1^Tλ_b |b(t)|} ,


	For each time step t, we take derivative of the objective function w.r.t. |b(t)|,
	
    δ J/δ |b(t)|    = - (λ_mis·1⃗_|b(t)>C|r(t)||
    	-  λ_mis·1⃗_|b(t)<C|r(t)|| + λ_b)
        = - λ_mis·1⃗_|b(t)>C|r(t)||
    	+  λ_mis·1⃗_|b(t)<C|r(t)|| - λ_b
       ≤λ_mis·1⃗_|b(t)<C|r(t)|| - λ_b
       ≤λ_mis - λ_b ≤ 0


	Since δ J/δ |b(t)|≤ 0, so in order to maximize J (the regulation service benefits), |b|=0. Therefore, 	when λ_b ≥λ_mis, b^*(t)=0 is optimal for ∀ C ≥ 0.



ieeetr
  


