title | author |
---|---|
ECSIM - a simple dynamic energy cost simulator |
Jaap-Henk Hoepman |
ECSIM is a simple dynamic energy cost simulator. It uses historical data about hourly electric energy costs together with average figures about the distribution of both energy consumption and solar energy production to compute the expected energy cost for a household. If a home battery is used, possibly attached to an electric vehicle, it can compute an optimal daily battery charging strategy that takes advantage of varying hourly tariffs to minimise the costs.
Assume a house with a local grid to which electric appliances (consuming energy), solar panels (returning energy) and an electric vehicle with a battery (that can both be charge or return energy) are attached. Let
-
$e_u$ be the total energy consumed by the electric appliances in a year, -
$e_v$ be the total energy consumed by the electric vehicle in a year, and -
$e_s$ be the total solar energy returned by the solar panels in a year.
All energy is measured in kWh. The local grid of the house is connected to the electrical grid through a (smart) meter. This meter measures:
-
$e[d,h]$ the hourly amount of electric energy consumed (positive) or returned (negative) to the grid (where day$d \in [0,\ldots,364]$ and hour$h \in [0,\ldots,23]$ ).
The hourly amount of energy consumed or produced depends on the amount of energy produced by the solar panels that hour (
The amount of energy produced by the solar panels at a particular hour on a particular day is estimated using
- information about the average fraction of yearly solar production produced each month, and
- information about the average fraction of daily solar production produced each hour.
The same method is used to estimate the hourly energy consumption. Let
-
$e_c$ be the total energy consumed from the gird in a year, and -
$e_r$ be the total energy returned to the grid in in a year.
We have
Typically, some of the solar energy produced is immediately consumed by household appliances, and therefore some of the production and consumption is not measured by the meter. We have
Assuming no losses when charging or discharging the battery, and provided the battery is empty at the start and the end of a year, we also have
The price you pay for electricity is determined by several factors. There are fixed costs (e.g. network operator connection costs, and energy supplier subscription fees) and variable costs (that depend on the amount of electricity, measured in kWh, consumed or returned). Fixed costs are ignored in the simulation.
The variable costs can be further divided into
- raw electricity price (EPEX)
$p$ (per kWh, changes every hour), - energy supplier surcharge
$s$ (per kWh), and - government taxes and levies
$t$ (per kWh).
Of these, only the electricity price itself is dynamic and changes every hour. The other factors are constant for a year. The tariffs for the next day are typically published at 15:00 the day before. These EPEX tariffs apparently differ for electricity consumption and energy returned (i.e. through solar panels or wind turbines). But most dynamic energy suppliers quote a single hourly tariff for both electrical energy consumed and returned. This is what the simulator also uses (for technical reasons) to compute an optimal battery charge strategy (but it offers the option to compute the actual price using these different usage and return tariffs). We write
Government taxes and levies only apply to the net energy consumption over the (annual) billing period. If you consumed
then the total taxes due equal
Energy supplier surcharges contribute to the energy cost in different ways. Some energy suppliers charge the surcharge both for energy consumed and for energy returned. Others only charge the surcharge for the excess of energy consumed (i.e. like the government taxes).
The total cost for the electrical energy consumed for a full year is computed as follows
- For energy suppliers that charge the surcharge for both energy consumption and return, the total cost for electrical energy becomes:
$$Z(e_n) \times t + \sum_{d=0}^{354} \sum_{h=0}^{23} e[d,h] \times p[d,h] + |e[d,h]| \times s$$ (where$|x|$ denotes the absolute value of$x$ ). - For energy suppliers that charge the surcharge only for the excess energy consumed, the total cost for electrical energy becomes:
$$Z(e_n) \times (s+t) + \sum_{d=0}^{354} \sum_{h=0}^{23} e[d,h] \times p[d,h]$$
In the simulator, two separate surcharges
Observe that the first case above corresponds to
Also observe that the total cost depends on the hourly energy consumption
The battery in the electric vehicle is primarily used to power the vehicle of course. It can also be used to take advantage of the fluctuating dynamic prices by charging it when electricity is cheap and discharging it when electricity is more expensive. It can also be used to temporarily store solar energy to return it when local energy demand is high or electricity prices are high. To accomplish this, a battery charging strategy
The simulator computes this charging strategy, using the following (generic) method. It assumes it is given some advance knowledge of the hourly tariffs, future energy consumption and solar energy production. In practice, when energy tariffs for tomorrow are published at 15:00 today, the look-ahead interval is
-
$e_c[h]$ , the hourly energy consumption, for$h \in [0,\ldots,H]$ , -
$e_s[h]$ , the hourly solar energy production, for$h \in [0,\ldots,H]$ , -
$e_v[h]$ , the hourly electric vehicle energy consumption, for$h \in [0,\ldots,H]$ , -
$p[h]$ the raw hourly energy tariff, for$h \in [0,\ldots,H]$ .
The output is a battery charging schedule
Let
under certain constraints. (Observe that any energy consumed by the electric vehicle is hidden in the battery charge.) Observe that this is equivalent to minimising
Define
as the charge of the battery at hour
-
$-C \le b[h] \le C$ , for all$h \in [0,\ldots,H]$ : the battery cannot be charged or discharged more than allowed by the electrical installation. -
$0 \le B[h] \le B$ , for all$h \in [0,\ldots,H+1]$ : the battery cannot create power out of nothing and cannot be charged beyond its capacity. Note this also guarantees that the battery is always sufficiently charged to drive the vehicle as specified by$e_v[h]$ .1 -
$b[h] = 0$ if$e_v[h] > 0$ ,$h \in [0,\ldots,H]$ : when using the car, the battery cannot be charged.
where
-
$C$ is the maximal hourly charge/discharge for the battery (11 kWh for typical electrical installations in the Netherlands). -
$B$ is the maximum battery capacity.
Because the simulator needs to optimise for a formula containing the absolute value of the variable
with the following additional constraints:
-
$b[h] \le b'[h]$ , for all$h \in [0,\ldots,H]$ , and -
$-b[h] \le b'[h]$ , for all$h \in [0,\ldots,H]$ .
Then if
For each month
- first spreading the annual production and consumption over the months according to the (average) fraction of energy produced and consumed per month (stored in the tables
SOLAR_PER_MONTH
andCONSUMPTION_PER_MONTH
, and - then divide this by the number of days in this month.
The vehicle energy consumption is evenly divided over all days of the year. This gives
The simulator is given some time to look ahead in the future: at hour
The simulator then uses SOLAR_PER_HOUR
and CONSUMPTION_PER_HOUR
) for this.
It then calls the generic method to compute an optimal battery charge strategy for the full look ahead period, but then uses the returned battery charge strategy
Footnotes
-
Specifying unreasonable vehcile usage constraints (eg demanding the car can immediately be used when the simulation starts) may prevent the simulator from finding a solution. ↩