Battery simulation
Background
Batteries have a large impact on the profitability and trading of solar assets. Our simulator uses a heuristic battery dispatch that can quickly simulate battery operation over the lifetime of the plant. This scheduling algorithm differs from the optimization used during operations (see battery optimization), because running an analytical optimization model over decades of operation would be impractical. For long-term simulation we use a simplified battery scheduler based on heuristics: simple rules that hold almost all the time and therefore approximate well what the analytical model would find. For example, the battery charges in the cheapest slot and discharges in the most expensive slot of a 12-hour look-ahead window, instead of planning each day as a whole.
The heuristic model below is based on DiOrio et al., 2020 (DOI:10.1016/j.apenergy.2019.114465)
For standalone battery assets (without solar PV), the solar generation for all time periods and grid charging is always enabled: the battery charges exclusively by purchasing electricity from the wholesale market during low-price periods and discharges during high-price periods to maximize revenue. A co-located battery charges from the grid only when the grid charging setting allows it.
Calculation logic
The heuristic simulates the battery one 30-minute slot at a time as a single energy store. In each slot, it looks at prices and solar generation over the horizon, decides whether to charge, discharge, offer capacity to the frequency control reserve market, or stay idle, and then updates the state of charge and the remaining capacity. This keeps the simulation of an asset over decades fast.
Nomenclature
All quantities refer to a single 30-minute slot.
Asset characteristics
: maximum exchange with the grid (kWh*); for DC-coupled assets, the smaller of the site inverter and meter ratings, expressed on the DC side of the site inverter
: maximum battery exchange (kWh)
: nameplate battery energy (kWh)
: degradation curve, the share of that remains after cycles (unitless)
: maximum cycles (unitless)
: battery cycle cost (JPY/kWh)
: charging and discharging efficiency (unitless)
: site inverter efficiency for DC-coupled assets, 1 for AC-coupled assets (unitless)
: minimum and maximum state of charge (unitless)
: initial state of charge, set to (unitless)
Tensor Cloud collects a single roundtrip efficiency for the battery, and the simulation applies all of the roundtrip loss on discharge: is the roundtrip efficiency and .
Input values
: price at time (JPY/kWh); see below
: FCR capacity price at time (JPY/kW)
: solar generation at time (kWh), on the AC side for AC-coupled assets and on the DC side for DC-coupled assets
: forecast of curtailment level () at time (unitless)
: maximum exchange with the grid at time (kWh)
: horizon, 24 slots (12 hours) (unitless)
The price is the scenario's day-ahead price. During the FIP period, the FIP premium is added whenever the day-ahead price is above 0.01 JPY/kWh. During the term of an Off-site PPA (a physical PPA), the PPA strike price replaces the day-ahead price. The simulation knows prices and solar generation over the whole horizon in advance (perfect foresight).
Battery status
: energy capacity at time (kWh)
: state of charge at time (unitless)
: cumulative cycles at time (unitless)
Decision variables
: energy that can still be charged into the battery (kWh)
: reserved energy for clipping (kWh)
: energy that can be charged while reserving space for clipping (kWh)
: energy that can be discharged from the battery (kWh)
: power that would be clipped without battery (kWh)
: power to discharge (kWh)
: power to charge from clipped solar (kWh)
: power to charge from non-clipped solar (kWh)
: power to charge from the grid (kWh)
Binary decision variables
: discharge decision
: high value charge time
: high value discharge time
: time to charge clipped solar power
: decision to charge from solar
: decision to charge from the grid
Set points
: preliminary power target (kWh)
: effective power target after constraints (kWh)
Output values
: meter exchange at time (kWh)
: energy flow solar to grid (kWh)
: energy flow battery to grid (kWh)
: energy flow solar to battery (kWh)
: energy flow grid to battery (kWh)
: curtailment avoided by the battery (kWh)
Initial settings
Throughout the page, square brackets denote the Iverson bracket notation**.
The battery starts at its nameplate capacity, with no cycles, at the initial state of charge:
At each time step, the actual exchange limit depends on current curtailment:
Determining decision variables
Our scheduling system depends on decision variables based on the scheduling horizon , which covers the current slot and the next slots. During the horizon, the maximum price at which electricity can be sold to the grid can be defined as:
We can calculate the relative (approximate) revenue streams for each use of the battery. At time , the revenues that can be obtained by charging from the PV depends on the maximum price at which this energy can be sold minus the missed opportunity of selling the energy right now:
The revenues from charging from the grid depend on the price paid for the energy now, including conversion losses:
The approximate revenues from charging when the energy would be clipped do not have any opportunity cost, as the energy would be lost anyway:
The revenue from discharging right now depends on the current price on the market:
We also calculate binary decision variables, which are all either 0 or 1, and are denoted by . If prices are at a minimum at the current time step (compared to the horizon), then this is a good moment to charge the battery:
If on the other hand prices are at a maximum at the current time step (compared to the horizon), and the horizon contains more than one slot with a positive price, then this is a good moment to discharge the battery:
The battery charges from PV only when all three conditions hold: prices are at their lowest, the revenue from PV charging is positive, and solar generation is positive:
When grid charging is off and the horizon contains slots where the battery can offer FCR, this decision is replaced by an FCR test (see frequency control reserve).
Charging from the grid follows the same logic, and requires grid charging to be enabled (, otherwise ):
The decision of whether to charge from clipped power depends only on whether the revenues are positive:
We can then determine whether we should discharge the battery at time :
This depends on whether this is a moment of good prices, if there is enough SoC, if the exchange limit is higher than the solar generation, and if the revenues from discharging are positive.
Heuristics optimization
The battery set points are determined from the values of the decision variables.
Reserved energy
For each time step , we first calculate how much battery energy is reserved for specific tasks, which limits how the battery can be used. First, we want to reserve some battery capacity for absorbing energy that would otherwise be clipped (for example by curtailment events). We can calculate the amount of power that would be clipped without battery as:
Ideally, we would want to absorb all this clipped energy, which otherwise would be completely wasted. We can calculate the reserved energy at each point in time that we need to keep in the battery to absorb the clipped energy over the horizon, counting at most per slot:
The energy that we can charge at each moment of time in the battery is defined as:
and therefore the energy that we can charge at time while still reserving capacity for clipped energy later, within one slot of battery exchange:
Similarly, the energy that the battery can deliver is:
Preliminary power set points
Next, we determine the power set points for the battery. These are preliminary values that may be infeasible; the constraints are resolved later.
The discharge power is only activated if is active, and is constrained by the battery power capacity and the remaining exchange capacity after solar (constraints related to SoC will be resolved later):
If is not active (=0), we can evaluate charging options in order of priority: clipped solar first, then solar, then the grid. If there is clipped power, use that to charge:
If it is good to charge from solar, use the remaining solar generation, battery exchange and battery space:
If it is good to charge from the grid, use what is left, within the import capacity of the grid connection:
We can finally calculate the target power from all contributions:
Based on the target power, we can update battery state. The target is first limited to . The losses are applied inside the battery: discharging removes more energy from storage than it delivers, and charging stores less than it takes in:
From this we can calculate the new stored energy, constrained by the SoC limits of the battery:
The lower bound keeps a battery that is already below from discharging further.
Based on the new stored energy, we can calculate the effective power exchanged, which would be the actual battery set point at time :
If the battery charges less than planned, the effective charge is assigned in the same order of priority: clipped solar, then solar, then the grid.
Power flows
Finally, we can calculate the results as the various flows between battery, solar, and grid. For an AC-coupled asset:
For a DC-coupled asset, the same flows are computed on the DC bus. Battery discharge and grid charging use the site inverter's headroom first, the remaining solar passes the site inverter up to its limit, and energy crossing the site inverter is converted with . See battery coupling.
Solar that cannot be exported after the battery has taken its share is split by cause. The part above is lost to the equipment limit; the part between and is curtailment ordered by the TSO:
We can then determine the level of curtailment avoided by the battery as:
with the virtual curtailment that the plant would have incurred without battery.
Degradation and end of life
The battery degrades with use, not with time. One cycle is a discharge equal to the current energy capacity, measured on the AC side:
The energy capacity follows the degradation curve, which starts at 100% at zero cycles, is interpolated linearly between its points, and stays at its last value beyond the last point:
Once exceeds the maximum cycles , the battery has reached the end of its life and stays idle for the rest of the simulation.
Frequency control reserve
When the asset participates in the frequency control reserve (FCR) market, the simulation decides in each slot whether to offer the battery's capacity there instead of trading on the day-ahead market.
A slot is eligible for FCR when all of the following hold:
- The slot is on or after April 1, 2024.
- The asset is outside its FIT period and outside the term of a physical offsite PPA.
- The battery is in operation.
- The exchange limit is larger than the energy the battery is expected to discharge for FCR.
- There is no solar generation in the slot. DC-coupled assets can also offer FCR in slots with solar generation (see below).
The capacity offered and the energy the battery is expected to discharge in each FCR slot are:
is in kW and is not limited by the inverter or meter rating. The FCR discharge price is assumed to be zero, so the revenue of an FCR slot is its capacity revenue minus the cycle cost of the expected discharge:
In each eligible slot, the simulation compares four options and chooses the one with the highest revenue:
- Spot discharge: discharge up to at the current price, if is active.
- Multimarket: charge from the grid and offer FCR in the same slot. The grid charge increases the capacity offered to . In the slots of the horizon where is highest, the battery charges as much as it can (up to ); in other slots, it charges only the energy it will discharge for FCR. This option requires grid charging to be enabled.
- FCR only: offer without charging, if the battery holds at least and the best FCR slots in the horizon earn more than discharging the same energy in the highest-priced slots of the day-ahead market.
- Idle, if no option has a positive revenue.
In an FCR slot, the battery discharges and does not discharge to the day-ahead market.
When grid charging is off, the battery recharges for FCR from solar. In the lowest-price slot of a horizon that contains FCR-eligible slots, it charges from solar if the best FCR slots in the horizon earn more than selling the energy needed for them at the current price:
A DC-coupled battery can also offer FCR in slots with solar generation, in three ways: solar covers the expected FCR discharge and the battery covers any remainder; the battery covers it alone; or the battery covers it alone while charging from the grid. Each variant is valued against selling the slot's solar on the day-ahead market, and the normal logic applies if none of them earns more. Solar that can neither be stored nor used for FCR in such a slot is curtailed.
* This refers to kWh per slot, i.e., the actual maximum energy that can be exchanged during a 30-minute slot. This is equivalent to the kW rating divided by two. For example, a 1 kW plant can produce 0.5 kWh in a 30-minute interval. We use the same convention for other variables.
** The Iverson bracket notation is defined as:
Validation
We validate our heuristic model against the analytical one to estimate the error that the simplifying assumptions introduce.
Further reading
- Tensor Cloud simulations: Explore project returns under different battery operating assumptions.
- Research on optimized battery control: See how simulation results inform operating decisions.
- Japan's FIP scheme for solar and storage: Review the policy context for co-located battery revenue.