Optimizing utility-scale battery storage dispatch

Simulating the impact of improved price forecasts on CAISO battery revenues

Luke Merrick
Myst AI

--

Executive summary

In this post, we explain how accurate price forecasts can increase revenue for utility-scale battery energy storage systems (BESS). To do so, we simulate historical revenue from for a hypothetical 100 MW / 400 MWh BESS under different dispatch schedules, using data from the California ISO (CAISO), queried through our partner Yes Energy. We offer two perspectives — an illustrative example that shows each step of schedule optimization in an overly simplified setting, and an expert simulation provided by a third-party asset owner-operator that offers more realistic numbers. In both cases we see that accurate price forecasts developed and deployed on the Myst Platform increased revenue compared to a persistence forecast (assuming tomorrow’s prices are identical to today’s prices). For the period between July 2020 and July 2022 that we studied, improving price forecasts versus persistence forecasts grew revenue by 3% in the illustrative example (only day-ahead energy) and 16% in the realistic example (energy and ancillary services).

Machine learning (ML)-powered price forecasts for energy and ancillary services can increase revenue by 16% over persistence forecasts, in a simulation ran for downtown San Francisco between July 2020 and July 2022.

Reproducibility: You can check out the public data and code behind this post in the accompanying Jupyter notebook.

Introduction

Pictured above, the 32-MWh Tehachapi Energy Storage Project was the largest lithium-ion battery storage system in North America when it was commissioned in 2014. Less than a decade later, it is common to see systems 10x larger going live.

As forces like the Inflation Reduction Act of 2022 accelerate the deployment of utility-scale storage, asset operators’ growing portfolios present their owners with both challenges and opportunities. Effectively managing these batteries — some of the most nimble power generators and consumers on the grid — is complex but can generate meaningful financial returns.

Battery systems can drastically change their power output in a matter of seconds, including to negative levels, allowing them to participate not only as generators of power in wholesale electricity markets, but also as wholesale consumers and providers of frequency regulation and reserve services in the ancillary services market. Therefore, batteries face a much larger set of options for scheduling than traditional generation assets.

Additionally, since batteries have limited capacity, their schedule in one hour affects the available options at subsequent hours (e.g. if discharging depletes the state of charge to zero, then discharging is not possible in subsequent hours, no matter how high prices go). This limited capacity means that BESS scheduling choices introduce substantial opportunity costs not faced by conventional generators, and these opportunity costs need to be managed effectively for optimal operation.

Since managing these complexities and choosing the right schedule can have a significant impact on revenue, schedule optimization is critical to the successful deployment of utility-scale battery storage systems. In the following sections, we explore the role forecasting plays and how it serves as a key ingredient to the application of mathematical optimization to dispatch scheduling.

Battery scheduling choices

One way to operate a utility-scale battery is to buy and sell power in the Day-Ahead (DA) wholesale electricity market. “Buy low, sell high” is the name of this game. Battery operators bid to purchase electricity when it is cheap, store this energy in their batteries, and offer it back to the grid at higher prices.

Example 1: Dispatching on a fixed schedule

To paint a grounded picture of schedule optimization, let’s consider a specific hypothetical example — the scenario of operating a 100 MW / 400 MWh battery out of Myst’s headquarters in downtown San Francisco. Admittedly, that might not be the best place to install dozens of shipping containers of batteries, but it does offer a vivid visual, so we’ll run with this example throughout this post.

Here are the average hourly Day-Ahead Locational Marginal Prices (DALMPs) for the EMBRCDR_2_N104 (downtown San Francisco) price node from July 2020 to July 2022.

Since our battery energy capacity in MWh is four times as large as the power capacity in MW, fully charging or discharging takes approximately four hours. Given this four-hour capacity, we can explore a simple scheduling approach of fully cycling the system once per day by buying power at the four cheapest hours and selling it at the four most expensive hours, a bidding strategy sometimes referred to as top-bottom-four or TB4. To make this example even simpler, we will look at the average price of electricity per hour at this price node and craft a fixed schedule to use every day in the two-year simulation period. As you can determine from the graph above, this approach leads us to a schedule of charging 09:00–13:00 (9am–1pm) and discharging 17:00–21:00 (5pm–9pm). Assuming 86% round-trip efficiency (as benchmarked by NREL), operating with this schedule across our example period (from the start of July 2020 through the end of June 2022) would average $13,904 in daily revenue for a total revenue of $10.1M, or $5M per year.

Participation in multiple markets

Solely participating in the day-ahead wholesale electricity market leaves a lot of money on the table, since profits from using a battery to offer frequency regulation or reserves can exceed those available from buying and selling electricity in the day-ahead market. The real-time electricity market may also offer operators better prices than the day-ahead market. Strategies in which operators participate in multiple markets offer greater potential profits at the cost of greater complexity.

In order to maximize their expected profit while respecting the physical constraints of their asset (like maximum capacity and charge/discharge rate) and market rules, battery operators contend with a host of interrelated decisions across multiple time periods and markets. Additional complexities arise as well. For example, warranty limits on number of battery cycles or total throughput make schedules that cycle the battery more frequently less attractive.The process of crafting bids given an optimal schedule is noteworthy in its own right, but for simplicity we’ll assume in this post that operators bid straightforwardly to ensure they trade in line with their chosen schedule.

With all of these options, considerations, and constraints, how do operators actually decide on the dispatch schedule? One popular and powerful tool is mathematical optimization.

Mathematical optimization for battery operation

Mathematical optimization quietly powers great swaths of the modern world, from electricity markets (Security Constrained Economic Dispatch, the tool used by grid operators to set power prices, is itself the outcome of a mathematical optimization), to manufacturing, logistics, and even the schedule of the National Football League. If you can represent your real-world problem with the right kind of mathematical expression, powerful general purpose software can crunch the numbers and determine an optimal solution for you.

The opportunity costs implied by battery assets’ limited storage capacities and ability to participate in multiple markets makes it impossible for these assets to achieve an optimal bidding strategy by just bidding at their marginal costs (something that is possible for other generators like gas turbines). Luckily, optimization algorithms can wrangle the complexity of battery scheduling fairly well. If allowed perfect knowledge of future market prices and a few other simplifications of reality, mathematical optimization is guaranteed to determine the highest profit schedule possible. Though we cannot attain this theoretical ideal in practice, we can still achieve compelling performance through mathematical optimization.

To formulate a problem solvable by mathematical optimization, practitioners define a set of decision variables, a set of constraints, and an objective. Battery optimizers use decision variables to represent the schedule (these track the amount of energy to charge and discharge at each hour of the day via which markets), and they use constraints to represent the known physical capacity and maximum charging and discharging rates of the battery. The tricky part comes in specifying the profit maximization objective, since revenue is a function of market prices, but market prices are not determined until after the schedule must be set.

In practice, the solution to this situation is forecasting. Using price forecasts, one can optimize forecasted revenue to generate a schedule before prices are actually determined. Practitioners thus formulate an objective function that tells the optimizer to maximize expected revenue based on a set of forecasts. If these forecasts are perfect, the result will be the optimal schedule in terms of actualized revenue. If the forecasts are inaccurate, however, the resulting revenue may be far from optimal.

Simulating battery schedule optimization

Let us return to the hypothetical downtown San Francisco battery example introduced above to simulate scheduling determined by mathematical optimization (rather than the fixed schedule used in our first example).

Example 2: Dispatching based on optimization and actual prices

Let us set forecasting aside for a moment and work through an example using actual price data (perfect foresight forecasts). For illustrative purposes let us consider an optimization in which we only schedule the battery into the wholesale day-ahead market. To do this, we will adopt a simplification of the Linear Programming (LP) approach from this paper.

Although we are still restricting ourselves to participating only in the day-ahead electricity market, this example still affords much greater flexibility than our fixed schedule in the first example. For example, this formulation adapts to each day’s forecasts, and it also allows cycling the battery multiple times, including via partial cycles (e.g. charge to 75% full, discharge to 25%, then charge to 50%).

For a full breakdown of the LP formulation and the code needed to solve it, take a look at the Jupyter notebook for this post. We include an abbreviated overview here:

Variables
chargeₜ and dischargeₜ — These decision variables represent the amount of electricity to charge and discharge at each hour t
SoCₜ — These additional variables represent the battery state of charge (SoC) at each hour
• The state of charge at each hour is governed by the following equation:
SoCₜ₊₁ = SoCₜ + RoundTripEfficiency × chargeₜ − dischargeₜ

Constraints
• Charging and discharging must be between 0 and 100 MW
• State of charge must be between 0 and 400 MWh
• Beginning and ending state of charge must be 0 MW (empty)

Objective
• Expected hourly revenue is the forecasted price at an hour times the difference between energy charged and energy discharged at that hour:
profitₜ = priceₜ × (dischargeₜ − chargeₜ )
• The objective is to maximize the sum of expected hourly revenues

Armed with this linear program formulation, we use off-the-shelf software to solve for the values of the decision variables, yielding our charge and discharge schedule for the operating day. Using historical price data, we simulate the resulting revenue of this optimization-driven scheduling strategy.

Let’s examine the schedule for one of the day’s in our historical simulation. Below we see both net power flow into and out of the battery over time and the resulting end-of-hour state of charge numbers.

Optimal schedule for the LP formulated using the actual DALMP prices (a perfect foresight forecast).

We find that the optimizer charges and discharges more frequently and not always completely, a more sophisticated approach compared to the single full cycle each day in the fixed schedule example.

When we crunch the numbers, scheduling via optimization with actual price data grosses a total of $15.6M over the evaluation period, an impressive 54% increase from the fixed schedule in the first example.

Example 3: Dispatching based on optimization and forecasted prices

Since actual prices are not available at scheduling time and forecasted prices must be used instead, let us extend our example to forecast-driven optimization. If we repeat the above simulation using the previous day’s prices as a stand-in for the next day’s, a practice called persistence forecasting, we gross a total of $14.0M in revenue, only 90% of the perfect foresight result.

Though this is better than our fixed schedule, we are losing out on quite a bit of revenue compared to perfect foresight. Can we improve our forecast and close this gap by even a little bit? Luckily, the answer is yes!

It turns out that by developing price forecasts via a machine-learning-powered system that incorporates the previous day’s prices, generation and load forecasts, weather data, and time trends, we can reduce average absolute forecast error (a frequently used metric to evaluate forecasts) by about 25% compared to a persistence forecast.

Over our two-year example period, the ML forecast achieves 25% lower average absolute error compared to the persistence forecast.

Running our optimization using this more accurate ML-powered forecast, we gross $14.4M in revenue for the evaluation period, which comes out to a 3% total revenue increase over persistence.

Optimization beats our hand-chosen strategy handily, and our more accurate ML forecasts give better revenue than simple persistence forecasts as well.
Here is a quarterly breakdown of revenues from our scheduling example.
Though the marginal benefits of both ML forecasts and perfect forecasts vary over time, we generally see both significant opportunity for revenue increase (perfect foresight) and significant realized revenue increase (ML forecast).

Real-world validation

Myst’s core competency is forecasting, not optimization, so we focused on illustrative simplicity in our examples. As a result, our simple linear programming formulation excludes a number of possible markets that real battery operators trade in (notably the ancillary services market). Thankfully, we work with battery operators whose core competencies include schedule optimization. One of our customers was kind enough to run a historical schedule optimization on our same fanciful downtown San Francisco example, using the same three sets of price forecasts (persistence, ML forecast, and perfect foresight using actual prices).

It would take more than a blog post to explain just the complexities of realistic battery dispatch via optimization, so we must gloss over some details here (additionally, the details of this particular optimization are non-public customer intellectual property). Interested readers may enjoy this paper by Tong et. al [PDF], which walks through a Mixed-Integer Linear Programming (MILP) formulation addressing several CAISO BESS applications.

In this scope of this post, we’ll just highlight how our customer’s simulation accurately considers the full set of possible transactions a BESS can engage in — buying and selling electricity in both the day-ahead and real-time wholesale electricity markets, offering frequency regulation up and down services, and providing spinning and non-spinning reserves. As a result, their formulation uses more forecasts than our illustrative example above — we provided them price forecasts for day-ahead wholesale electricity, real-time wholesale electricity, regulation up, regulation down, spinning reserves, and non-spinning reserves.

Since their optimization considers all possible market participations, this simulation paints a more complete and realistic picture of battery operation.

In a realistic optimization simulation allowing participation in ancillary services and real-time markets, the BESS nets much higher revenues, and the gap between revenue from optimizations performed on persistence forecasts and more accurate ML forecasts and perfect foresight is much larger.
Using more accurate forecasts drives a steady marginal revenue increase over the entire time period of the simulation.
Summary results from our customer’s simulation.

Given that our customer’s optimizations consume a larger set of forecasts and consider a broader set of possible transactions, it isn’t straightforward to determine exactly why revenue increase is so much more significant when using ML-powered price forecasts versus persistence forecasts. The two examples are not really meant for comparison, though. Rather, these realistic simulation numbers are a better quantification of the value of forecasting-plus-optimization in practice, while the earlier illustrative example primarily offers insight into the forecasting-plus-optimization process, rather than realistic revenue estimates.

Recap

In this blog post, we have explained the roles that forecasting and mathematical optimization play in the operation of utility-scale battery storage. We covered the complexity of scheduling options battery operators choose from, the power of mathematical optimization to determine profitable battery dispatch schedules that satisfy physical and market constraints, and the necessity for accurate price forecasts to power these optimizations. We saw that day-ahead persistence price forecasts enable an optimization to generate useful battery dispatch schedules, but that improving the accuracy of price forecasts can drive significant increase in revenue: 3% in an illustrative simulation restricted to the day-ahead electricity market, 16% in a more realistic backtest run by a battery asset owner and operator.

The Myst Platform enables asset owners to rapidly build and deploy accurate, recurring forecasts for use in downstream applications, such as optimal battery dispatch. If you are interested in a demo, please schedule it here, or drop us a line at hello@myst.ai!

--

--