Data engineering: the invisible backbone of digital
Behind every digital application lie data infrastructures that collect, transform, and make information …
At muleML, we started with materials physics and battery electrochemistry. Our first models grew out of questions about what happens inside the cells. How can we estimate state of charge? How much energy is still usable? How does battery capacity change with use and over time?
But when we move from an individual cell to a BESS operating in the market, the problem changes. The main objective becomes answering this question:
Which market participation strategy delivers the best expected margin, taking into account the system’s physical constraints, degradation, and uncertainty in prices and activations?
To address this problem, we had to extend our models to what happens around the battery. Prices, market deadlines, contractual commitments, and the grid operator’s requirements all affect how the system is used. Above all, we had to simulate commercial decisions made at different points in time, as the available information and revenue opportunities change.
In this article, we explore how to build a model for the Italian market, whose regulatory framework is defined by the Testo Integrato del Dispacciamento Elettrico (TIDE), Terna’s Grid Code, and the electricity market rules administered by GME. We focus on energy arbitrage and reserve and balancing services, leaving capacity remuneration mechanisms and other long-term contractual arrangements outside the scope of this discussion.
Although the discussion focuses on Italy, the proposed methodology can also be adapted to other electricity markets.
Consider a 10 MW, 40 MWh BESS. We assume that the system can deliver its full rated power, while bearing in mind that, in a real installation, available power and energy also depend on the batteries’ state and operating conditions.
Let’s follow it through a trading day. For clarity, we consider a one-hour interval, while recognizing that the Italian market also uses products and schedules with 15-minute resolution.
To understand what the BESS can do between 18:00 and 19:00, we need to reconstruct the decisions made before that hour. At each stage, the available information changes, along with the commitments the system must meet.
The initial position is established the day before delivery. In the Day-Ahead Market (DAM, known as MGP in Italy), the operator submits offers based on price forecasts and the expected state of charge. Prices and accepted quantities are only known once the auction results are available. Suppose the outcome leads to a scheduled grid injection of 8 MW between 18:00 and 19:00. From that point on, the trade is included in the margin calculation, and the injection schedule becomes the reference for subsequent decisions.
As delivery approaches, the position can change. In the Intraday Market (IDM, known as MI in Italy), the operator can reduce the scheduled injection by buying back some of the energy already sold, for example if the BESS has less energy available than expected. At the same time, if a reserve commitment has already been made, any change to the schedule must preserve the power and energy needed to meet it. Intraday trading sessions and service procurement processes overlap. The model therefore needs to track the deadlines for each individual product.
For ancillary services, commitment and activation occur at different times. In Italy, Terna procures the resources needed for balancing and redispatching through the Balancing and Redispatching Market (Mercato per il Bilanciamento e il Ridispacciamento, MBR) and specific reserve procurement mechanisms. Now suppose that the BESS also commits to keeping 2 MW of upward reserve available. This availability must already be accounted for during planning, even though we do not yet know when activation will be required or to what extent. The energy actually exchanged becomes known during delivery. For FCR (Frequency Containment Reserve), it depends on the locally measured frequency; for aFRR (automatic Frequency Restoration Reserve), on the regulation signal; and for mFRR (manual Frequency Restoration Reserve), on the activation instruction. The model must therefore represent the power committed as reserve separately from the energy actually exchanged, applying the specific remuneration rules for each service and procurement mechanism.
After delivery, the accounts are settled. Settlement determines the financial value of trades and services and settles any imbalances. If the BESS changes its scheduled injection in response to a service activation, the model must distinguish the energy attributable to that service from any residual deviations. Settlement must account for the specific pricing rules and the responsibilities of the parties participating in the market.
To simulate this day, then, each piece of information must enter the model when it becomes available. The price known after the auction is used to calculate an offer’s outcome. The decision to submit that offer is made earlier, on the basis of forecasts.
When we say that “the BESS sells energy” or “offers reserve,” different parties may be behind those decisions. Let’s look at their roles:
For the owner or developer, simulation is also useful before the system enters operation. It allows different revenue stacks to be compared and commercial operators’ proposals to be assessed. The same BESS can earn the same market margin yet leave the owner with different amounts, depending on how the contract allocates revenues, fees, and imbalance costs.
Relying on a single revenue stream can put the economic viability of a BESS at risk. To reduce this dependence, operators use revenue stacking: combining several revenue streams from the same BESS. Adding reserve services to arbitrage, for example, allows the system to earn revenue even when energy trading offers limited margins or uses only part of the available power.
This is where the problem becomes difficult. To estimate the earnings from combining arbitrage and reserve, it might seem natural to assess the two activities separately and add the results. Each calculation, however, would then assume that the entire battery is at its disposal, without accounting for commitments arising from the other activity.
Suppose that, between 18:00 and 19:00, the arbitrage model schedules the full 10 MW for grid injection. For the same hour, the reserve model plans to offer 10 MW of upward reserve. What would happen if Terna requested full activation? The system would have to deliver the 10 MW already scheduled plus another 10 MW. Adding the two financial results would attribute revenues to the BESS from two commitments it cannot fulfill simultaneously.
As in our earlier example, a feasible combination might be to schedule a sale at 8 MW and keep 2 MW of upward reserve available. We also need to check that the state of charge can support the sales schedule and any activation for the required duration.
We can then add the revenues from compatible operations. To understand how much value reserve adds, we compare the margin from this strategy with the margin the same BESS would have earned from arbitrage alone. The difference accounts both for the earnings from offering reserve and for the margin forgone by keeping those 2 MW available: the latter is the opportunity cost of reserve provision.
Physical compatibility alone, however, is not enough. We must also check that combining the activities is permitted under the market rules and the operator’s contractual commitments.
The simulation reproduces the full sequence of market decisions and their consequences. At each stage, optimization chooses what to do with the information available. Simulated execution advances time and reconstructs the effects of those decisions on the battery and the financial outcome.
Let’s return to our 10 MW BESS. It is scheduled to inject 8 MW between 18:00 and 19:00. While the relevant market windows remain open, it can use the remaining 2 MW for an additional sale or offer them as upward reserve. The optimizer compares the options that are compatible with the expected state of charge and existing commitments. Its calculation of the expected margin also includes the cost of degradation. A sale can generate more revenue yet leave a lower margin if the cost of additional wear exceeds the extra revenue.
During simulated execution, prices, offer outcomes, and activations enter the model as they become available. If the 2 MW of reserve are activated for half an hour, the system increases its output from 8 to 10 MW and injects an additional 1 MWh into the grid. The model calculates the margin achieved in that scenario, updates the state of charge to account for losses, and estimates the degradation associated with the operating profile. Over time, degradation can reduce usable energy and available power, limiting the offers the BESS can sustain.
We can advance the simulator using rolling-horizon optimization. At each new decision window, the optimizer starts from the updated BESS state, incorporates new forecasts, and shifts the planning horizon forward. It recalculates the decisions that remain open while respecting commitments already made.
We originally thought we could cover everything in a single article. We then realized that the complexity called for a more gradual approach and decided to split the discussion into two parts.
In part two, we will build the simulator step by step, from input data to market decisions. We will start with a numerical example using a simple estimate of activation probability, then explore uncertainty in greater depth.
Finally, we will extend the simulation to a full year to understand, under the same market conditions, how much margin reserve adds to arbitrage, what risks it entails, and how it affects battery degradation.
The regulatory framework described in this article reflects the provisions applicable in November 2026. The numerical examples are for illustrative purposes.
Behind every digital application lie data infrastructures that collect, transform, and make information …
Batteries reaching the end of their life are not necessarily waste: they can open new market opportunities and …
The evolution of data management systems is deeply tied to the way data is represented and organized in memory …