{'fraction_non_alphanumeric': 0.029729199372056515, 'fraction_numerical': 0.013000392464678179, 'mean_word_length': 4.545429815016322, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Market-Driven Energy Storage Planning for Microgrids with Renewable Energy Systems Using Stochastic Programming

Battery Energy Storage Systems (BESS) can mitigate effects of intermittent energy production from renewable energy sources and play a critical role in peak shaving and demand charge management. To optimally size the BESS from an economic perspective, the trade-off between BESS investment costs, lifetime, and revenue from utility bill savings along with microgrid ancillary services must be taken into account. The optimal size of a BESS is solved via a stochastic optimization problem considering wholesale market pricing. A stochastic model is used to schedule arbitrage services for energy storage based on the forecasted energy market pricing while accounting for BESS cost trends, the variability of renewable energy resources, and demand prediction. The uniqueness of the approach proposed in this paper lies in the convex optimization programming framework that computes a globally optimal solution to the financial trade-off solution. The approach is illustrated by application to various realistic case studies based on pricing and demand data from the California Independent System Operator (CAISO). The case study results give insight in optimal BESS sizing from a cost perspective, based on both yearly scheduling and daily BESS operation.


INTRODUCTION
The need for a Battery Energy Storage System (BESS) to serve as a buffer for electric energy is palpable for microgrid systems that have a large penetration of intermittent renewable energy sources. A BESS may be economical for both islanded microgrids and a for grid-connected system, as a BESS increases reliability during outages and provides revenue or grid services such as peak shaving, voltage regulation, and arbitrage power trading during normal operation (Lasseter, 2002;Donadee, 2013;Kousksou et al., 2014) .
Applications of a BESS can be found in various settings to assist with renewable power integration. It has been applied to the problem of harmonic distortion, generally known as voltage regulation, which may occur in standalone operation (islanding) of a microgrid (Yang et al., 2014;Hanley et al., 2008). Specifically, a BESS reduces (or smoothens out) variability in Photo Voltaic (PV) and wind energy production (Teleke et al., 2010;Zheng et al., 2015) by different control strategies such as a rule-based control and a model predictive control (MPC). A BESS in conjunction with PV and demand forecasting can help shift renewable generation to times of higher power demand or lower electricity price via an MPC technique (Sevilla et al., 2015). A mathematical model for a large BESS system was performed in (Zhang et al., 2015) as a reduced four state space equations to model the relation between the bulk power grid and a BESS.
The benefits of BESS in coping with variable renewable energy production are evident, but the costs associated with financing and installing BESS are often prohibitive. A good example is a residential setting (Holbert and Chen, 2015), where a BESS may not produce sufficient revenue from energy arbitrage to achieve investment payback with the current BESS prices without government incentives. At the same time, BESS costs are anticipated to drop in the near future and investment banks are expecting the payback time for unsubsidized investment in electric vehicles (EV) combined with rooftop solar and BESS (Houchois et al., 2014) to reduce to around six to eight years. Also, the economies of scale due to the adoption of EV and rapid improvement of battery technologies will likely reduce BESS prices. The projected drop in pricing of BESS is also expected to lead to an additional three-year reduction in payback time to three years by 2030 (Nykvist and Nilsson, 2015;Sachs, 2014).
Optimal BESS sizing from an economical perspective must find the optimal trade-off between critical design parameters that include BESS sizing, BESS life expectancy due to battery degradation and total revenue from utility bill savings due to energy arbitrage. Holistic BESS scheduling models that aim to capture all cost aspects were developed in (Nguyen et al., 2012) to maximize the overall profit of an existing wind-storage system. Economic models were used in (Ornelas-Tellez et al., 2014) to predict the market price to optimize the operation of existing energy resources in a microgrid, but no future investments were considered. Operational stochastic control and optimization in (Zachar and Daoutidis, 2016) were designed as an MPC to ensure sufficient energy as an economic dispatch problem.
Motivated by the need to find the optimal BESS investment as a function of time considering capital and O&M costs, as well as operational revenues, this paper proposes a stochastic optimization approach that leverages mixed integer and real (convex) optimization to formulate financially optimal BESS sizing solutions. The stochastic optimization is used to address the variability in prediction and forecasting of energy and BESS pricing to determine when is the optimal time to invest in a BESS. The convex optimization is used to compute globally optimal solutions for BESS sizing parameters, given the operational model and the price variability in the day-ahead market.
The paper is outlined as follows. First, the problem formulation and the system topology for financial optimization are summarized in Section 2. The mathematical framework is summarized in Section 3, explaining the optimization techniques, objective functions and the constraints. Different operating scenarios are discussed and compared in Section 4 to cover cases of extreme high/low power variability in solar, wind and demand patterns. In Section 5, different BESS installation cases and optimal BESS sizing for a case study of a real microgrid are presented. Fig. 1 illustrates the structure of power market and microgrids used in this paper. The microgrid is modelled as a subset of the market µG ⊂ N , and demand, renewable generation, and BESS power in both market (m) and microgrid (µ) are denoted by P d , P RE , and P b , as illustrated in Fig. 1  The net demand P net , which is the actual market demand (including all microgrids' demand) minus the total renewable power available in the market, is computed via

Microgrid and Market Structures
where P gi indicates power provided by generator i and P µ = Σ j∈µG P dj ,µ + P bj ,µ − P REj ,µ (2)

Market Clearing Price Modeling
Assuming that the microgrids will pay the hourly market clearing price (MCP) in the future instead of predefined constant or time-of-use (TOU) rates, a price model is required to anticipate the MCP at different times for optimal operation of microgrids.
Typically, Independent System Operators (ISO) aggregate the bids received from generators and cross it with the net demand hourly profile of the market to define hourly MCP. It is assumed that the MCP is solely a function of the net demand in that λ P is linearly correlated with the market net demand P net via λ P = α P net + β.
(3) This pricing modeling has been validated in the literature (Huang et al., 2015;Verzijlbergh et al., 2014). It is assumed for simplicity that the parameters of the MCP model (α, β) remain constant throughout the 15 year modeling horizon. However, the optimization could consider more detailed and dynamic models where the pricing model parameters vary as generators are added or removed.
To model the effects of different generators' bidding strategies and maintenance schedules on different days of the week (weekdays and weekend) and different seasons (summer and non-summer) on MCP, four distinct MCP models are fit from historical CAISO demand and pricing data.

Microgrid and Power Market Growth
For realistic financial predictions and optimal sizing of the BESS, the financial model considers the annual growth of both the market and the microgrid. The growth of the market and the microgrid takes into account all components, i.e. demand, solar and wind.
For simplicity, we assume a fixed annual solar growth (ASG) defined by where S t represents the vector of hourly solar profiles of the current year. Hence, with a fixed ASG, the net solar power S t+1 contribution is predicted to grow exponentially as Similarly, we assume a fixed annual wind growth (AWG) as The CAISO historical demand data shows different rates of increase at different hours of the day, specifically power demand at the peak hour has grown faster than at offpeak hours. to account for this effect, we define an annual demand growth profile (ADGP) that varies by hour of the day as , where D t is the vector of hourly power demand at year t and ⊘ denotes element-wise division.

Objective Function
A stochastic programming model is developed to capture all possible scenarios of solar and wind generations, demand variations, and supply bidding strategies in the BESS sizing and operation problem.
The objective function is defined to minimize the expected energy cost, i.e. the sum of energy purchase costs and the BESS investment cost over a time period T while considering annual growth in solar, wind and demand. Mathematically, for an optimization horizon T and scenario set of Ω, the objective function is defined as min where P r i refers to the probability of a scenario i and i J b,t refers to the investment cost of BESS installed in year t. ii J i,t is the total cost of energy purchased from the market in year t for the scenario i, and is given by and Λ i,t are respectively the hourly vectors of amount of energy purchased from the energy markets and MCP in year t and scenario i.
iii v b,T accounts for the remaining value of the unexpired BESS at the end of the simulation period. iv As is common in economic models v t = (1 − γ) t discounts the monetary value in future years using an annual interest rate of γ.

Constraints
Resource Adequacy: At any time step, the microgrid control center (MGCC) must ensure that there is adequate power to supply demand. Therefore, any mismatch between the power demand and the summation of solar power output, and BESS discharging power must be purchased from the market to keep the power balance at any time step t and scenario i. This constraint is summarized as P REi,t + P bi,t + P i,t = L i,t (5) where P i,t is the power purchased from the market.
Battery Constraints: First, the battery charging/ discharging power must be between the limits, i.e. −P bmax ≤ P bi,t ≤ P bmax To avoid damages due to a deep (dis)charge cycle of the battery, the stored energy in the battery is constrained by its maximum and minimum SOC limits (ρ min , ρ max ) as ρ min E bmax ≤ E bi,t ≤ ρ max E bmax where ρ min and ρ max are typically around 10% and 95%. The energy stored in the battery is denoted by E bi,t and calculated via E bi,t = Σ t h=1 P b i,h ∆t + E bi,0 with E bi,0 as the initial BESS energy and ∆t time difference between two consecutive time steps.
It is also desired to keep the final SOC of the BESS equal to its initial value at the end of each day. This constraint is needed to avoid transferring energy between days and included via E bi,t 1 = E bi,0 for any t 1 ∈ {24k hours, k ∈ N}. Finally, the ratio between the nominal power rating and energy rating of the BESS implemented by 2 × E bmax i = P bmax i as the last battery constraint. Obviously, more advanced battery constrainst that take into account parasitic loss and efficiency parameters could be used to provide even more realistic battery constraints.
Power Congestion Constraint A power congestion constraint limits the power purchased from the market due to the physical limit of the microgrid at the point of common coupling (PCC) or upstream power lines. Power congestion constraints may, for example, limit the BESS' ability to charge at P bmax i during (or within) the cheapest price. By including a power congestion constraint −P L ≤ P ≤ P L (6) the BESS will be charged over a longer time frame to accommodate the congestion limit P L .

Scenarios
The most accurate results would be obtained by simulating a typical meteorological and climatologically representative timeseries over a year (or longer), but this is computationally intensive. Instead, we consider year's (2015) worth of data, downsampled to a set of typical days and these days are repeated each year.
Subsequently, a manual clustering is applied to classify demand profiles in representative patterns. The clustering assembles the data into four main groups that resemble a summer/non-summer and weekday/weekend separation. Fig. 2 illustrates all demand profiles clustered in those four groups, each identified by a distinct color. The clustering can then be used to formulate an average for each group as depcited in the top plot of Fig. 3. Although usually intermittent in nature, solar and wind power profile over the complete state of California tends to be smooth and easily seperable into a small number of distinctive patterns. Only a binary classification of high and low is applied in this paper to cover the state-wide range of patterns in solar and wind power generation. Clusters were obtained by the popular clustering method k-means (MacQueen et al., 1967), which aims to partition time series data into two clusters. Clear days are presented as the high solar case, whereas overcast days are denoted by low solar case. The bottom plot of Fig. 3   is given in Table 1. Clearly, more granular clustering, e.g. by adding seasonal effects on variables such as (solar, wind), will increase the accuracy of the optimization, but also the computational cost. Each scenario is assigned a probability consistent with climatological data in a certain location. The probability of each scenario is defined by multiplying the corresponding individual probabilities and is used as a weighting of that scenario in the optimization of (4), e.g. P r({HS, LW, SW D}) = P r(HS) · P r(LW ) · P r(SW D).

Time [Hours]
(8) Individual probabilities of solar, wind and demand are mutually independent and the probability of all possible scenarios sums to 100%.

Market Clearing Price Models
The MCP models developed for each demand cluster are shown in Fig. 4.  (Table 1) for the first year.
The CAISO MCP λ P derived from Eq. (3) is the main input to the market model to determine the size and the daily operation of the BESS. The parameter λ P varies based on the different scenarios as shown in Fig. 5. The highest market price is associated with low solar, low wind and summer weekday demand (scenario 4). Conversely, the scenario with non-summer weekend demand, high solar, and high wind results in the smallest λ P . Negative pricing may appear also as a result of the assumed inability to curtail renewables; after renewable generators lose their protected "must-take" status, they will be curtailed in such a situation to avoid negative pricing. In this case, it is cheaper to temporarily pay market participants to take power rather than turning off base-load power plants.

Case Study
The case study uses CAISO demand data and the location marginal pricing (LMP) node (UCM 6 N001) located at (32 • 53'00.9"N 117 • 13'21.2"W) which is the trading node containing UC San Diego. The simulated case has a peak market demand around 45 GW and a low demand (baseload) around 18 MW. The 2015 utility scale solar and wind peaks are around 5.7 and 2 GW respectively. Clear solar days are assumed to occur 30% of the time, overcast days 70%, and high wind 40% of the time and low wind 60%. Different demand scenarios follow the calendar with 96 and 36 days for summer (May 1 to Oct 31) weekday and weekend, respectively and 165 and 68 days for non-summer weekday and weekend, respectively. By that, the P r shown in (8)  The characteristics of the microgrid conform to the UC San Diego microgrid. Similar to CAISO, demand is split into summer and non-summer weekday and weekend based on actual demand data collected from campus with demand peaks of (42, 36, 35, and 32) MW for summer weekday, summer weekend, non-summer weekday, and non-summer weekend and base-load of 34 MW for both summer scenarios and 30 MW for non-summer as shown in Fig. 7 (top plot). Those profiles are matched with the existing market scenarios in Table 1. Microgrid generation is 20 MW from gas turbines and solar power of peak-topeak ratio is 10 MW and both high and low solar clusters are shown in Fig. 7 (bottom plot). Noted here that the low solar profile for the microgird is more intermittent compared to the market case because of the geospatial effect. The maximum allowable power demand from the grid (P L ) is 45 MW. Since microgrid energy sales to the market are not permitted, overgeneration would have to be curtailed. The growth rates of solar and demand are both 3% for the microgrid. The growth of solar and wind are both assumed to be 7% for the microgrid. To compute annual demand growth profile, CAISO demand data in 2013-2015 is used. The market annual demand growth profiles for non-summer scenarios are assumed scalar and equal to 2% while those for summer scenarios are shown in Fig. 8.
The BESS pricing cases (J b,t in Eq. (4)), which all include government subsidies and incentives, are divided into two categories named a and b.Each category includes 10 cases (called a-1, · · · , a-10, b-1, · · · , b-10) which start from a price value between 117 $/kWh and 175.5 $/kWh. The price functions of all cases in category a converge to 100 $/kWh within 15 years (Nykvist and Nilsson, 2015) while those of the cases in category b decay with a constant rate of 1% every year. The life cycle of BESS is assumed 10 years for all cases. Fig. 6 shows optimization results for the BESS installation by year. On the y axis prices increase from lower to higher.

NUMERICAL RESULTS
On the x axis prices decrease from left to right as the years progress. For both cases no installation was applied before the year 5 (Y5) but as the BESS prices drop faster in case a compared to case b the installation went up to case a-8 compared to case b-4. The yearly installation plan of the BESS results to be large at one year followed by smaller installation few years before and after. After case a-8 and case b-4 no installations have resulted.  Fig. 9 shows a sample day of price case a-8 as P u , P b and λ P , where microgrid power purchase with storage is presented in the left axis and λ P is presented in the right axis for Y1 and Y15. Adding BESS in the microgrid changes the behavior of the microgrid demand with a new peak between 1 and 3 AM during a market price depression. Specifying P L = 45 MW limits the charging of the BESS from hour 1AM to 3AM to not exceed a total microgrid demand of 45 MW. Comparing λ P in Y1 and Y15 shows the effect of larger solar for a midday price minimum and stronger peak demand growth in the evening. Therefore the price curve shows two peaks and a pronounced evening peak in Y15. The price curve triggers two BESS cycles per day to leverage the margins between minima and peaks.

CONCLUSIONS
As the need for Battery Energy Storage System (BESS) is increasing to cope with intermittent energy production from renewable energy sources, optimal BESS sizing from an economical perspective is a challenging problem. To optimally size the BESS in the design stage of a microgrid, the trade-off between BESS cost, energy bill savings, and lifetime must be taken into account. Using a stochastic optimization approach we optimally size and schedule a BESS in a microgrid based on market energy pricing. Variability of wind and solar energy resources, the variability of energy demand, and a dynamic market price model that considers feedback from microgrid energy decisions are considered. Decreasing BESS costs over time are also modeled. The modeling framework contains significant flexibility and realism for microgrid planning.
Assuming the market clearance price model and net demand forecasts in our case study for CAISO and a particular trading node, the results show that a microgrid can start saving money with wholesale market energy trading once BESS prices drop below $150/kWh. The operational scheduling of BESS is not targeted to shave the microgrid peak but rather to profit from wholesale energy cost margins. Additional constraints could be added to achieve a hybrid between local and market objectives.