2.1. Power Balance
The most important aspect of the system is to ensure that the load demand is met at all times and that the power balance is obtained. From
Figure 1, the power balance equation in time step
t can be written as shown in Equation (
1).
is the power supplied by the PV system,
and
are the powers charged and discharged from the battery,
and
are the powers bought from and sold to the grid, and
is the efficiency of the battery inverter.
In order to reduce the power peaks as seen from the grid, and thus enable peak shaving, a maximum limit on the power that can be drawn from the grid in any time step is applied as . Moreover, both the power bought from and sold to the grid must be of positive values, .
2.2. Battery Degradation
The nature of a battery is such that its usable capacity decreases as it ages. The state of health (SOH) of a battery is a measure of the current available capacity, given as a percentage of the nominal capacity. It is common to differentiate between two factors influencing the SOH; cyclic and calendric aging [
11]. In addition, the aging of a battery is influenced by several operating factors, such as inefficient charging, high charging voltages and currents, deep discharging, and extreme temperatures [
7].
Cyclic aging is caused by energy throughput in the battery, and for each cycle the battery goes through, a certain percentage of available capacity is lost. For most lithium-ion batteries, the available capacity is sensitive to both the maximum number of full cycles and the depth of discharge (DOD) level of each cycle [
12].
Figure 2 shows the number of cycles versus DOD for a nickel manganese cobalt oxide (NMC) battery, a commonly used storage chemistry for small-scale behind-the-meter applications. The figure is based on references [
13,
14] where a least square fitting method was applied to test data.
However, a battery is not always operated using regular cycles. This is especially true for behind-the-meter applications, where the battery operation is largely dependent on signals received from outer factors such as the energy price, power demand, and local power production [
13]. It is therefore necessary to build a cyclic degradation model which reflects the irregular behavior of the battery.
Modeling the cyclic aging of a battery is difficult as it depends on both the energy throughput, cell chemistry, and operating conditions, such as temperature, cell voltage, and DOD. As such, no single model can be used for all chemistries, and a near accurate representation of the cyclic aging for each chemistry would be a highly non-linear function. Several methods have been proposed [
15,
16]; however, the model used in this paper is based on the curve from
Figure 2: the degradation of each regular cycle, i.e., when discharging the battery from full capacity to a specified DOD level, is modeled as
, where
Lcyc is the cycle life of the resulting DOD and
is the percentage degradation in time
t. A similar model is also used by References [
13,
17]. Although being cell specific, it can easily be adapted to fit all chemistries where such a curve is available and can therefore produce accurate results for the chosen battery technology.
As previously mentioned, it is desirable to build a model which accounts for irregular battery cycles. In the paper by Wang et al. [
13], an irregular cycle is modeled as the difference between two regular cycles, as follows:
Here, DPcyc represents the degradation in each time period. The absolute value is due to the fact that both charging and discharging contributes to a degradation of the battery, and the factor of 0.5 reflects that one charging or discharging process contributes to half of the degradation of a full cycle.
As opposed to cyclic aging, calendric aging is independent of energy throughput and comprises all internal processes leading to the degradation of a battery when idle. The capacity lost during these idle intervals is mainly dependent on the storage state of charge (SOC) and temperature. Several papers ([
15,
18]) have studied the change in the SOH for lithium-ion batteries when storing them at different temperatures and SOCs and found that the calendric aging did not increase linearly with the SOC, nor with temperature. By assuming a constant temperature, the model can be simplified, and several sources ([
5,
19]) propose a solely time-dependent model of the calendric aging. In this paper, the degradation in each time step is expressed as
, where
Lcal is the shelf time of the battery given by the manufacturer.
Both the cyclic and calendric aging affect the SOH of the battery. With the total degradation expressed as DP, the battery is at the end of its lifetime for DP = 100%. If the end-of-life criterion is set to 80% of full capacity, a typical replacement criteria for lithium-ion batteries, the SOH of the battery in each period can be modeled as , where DPt is the total degradation in per unit in time period t.
According to the state of the art, the total degradation of the battery can be modeled in several ways. Some articles ([
5,
20]) model the total aging as a superposition of the cyclic and calendric aging, while others ([
7,
15]) argue that the two processes are independent of each other: the total aging is equal to
DPcyc if the battery is operating, and
DPcal if it is idle, as seen in Equation (
3):
Other articles again ([
13,
19]) argue that the total degradation in each period can be modeled as the larger one of the two aging processes. If
DPcyc is higher than
DPcal for all DOD levels, and noting that
DPcyc is equal to zero when the battery is idle, this approach can be seen as a simplification of Equation (
3). The resulting model is:
2.4. The Cost of Energy
Each kWh of energy delivered through the grid is subject to an energy tariff, which can be either a flat rate or a time-dependant rate. Traditionally, the flat rate is the most widespread tariff scheme in Norway. However, with the introduction of smart meters the consumers will be more exposed to price signals in the power market, and time-based tariffs may become increasingly deployed: instead of charging a constant price, the cost per kWh is dependent on the time in which that kWh is used. One way of implementing this is to base the energy tariff on hourly rates equal to the spot prices, called “real-time pricing” (RTP). In Norway these rates are decided by Nord Pool [
22]. Under an RTP tariff scheme, battery storage systems may prove economically valuable as they can be used for price arbitrage operations. This is especially beneficial for areas where the difference between on and off-peak energy tariffs are high, which may be the case for Norway in the near future. According to a study made by Statnett last year, the Norwegian spot market will see more volatile prices and higher price peaks as the implementation of fluctuating power sources like solar and wind continue to grow [
23].
In addition to being charged for each kWh of energy consumed, commercial customers are subject to a peak demand charge—a fee charged for the maximum power drawn from the grid each billing period. This charge may be of a substantial amount and is set high to reflect that the consumption peaks cause a stress on the grid.
The total cost of electricity for each billing period can be modeled as shown in Equation (
5), where
t indicates hours and T is the last hour of the billing period.
cel,t is the energy tariff,
cfeed-in,t is the feed-in tariff, and
cpeak is the peak demand charge.
Pgrid,b,t is the power bought from the grid each hour,
Pgrid,s,t is the power fed back (or sold) to the grid each hour, and
Ppeak is the maximum amount of power drawn from the grid during the billing period.
2.5. Battery Model
When the battery is operating, it can either charge or discharge—but never both at the same time. In each time step, the charging or discharging powers are limited by the nominal power of the bi-directional inverter to avoid over-voltages and high currents,
and
. In each operating period, the energy in the battery is either increased or reduced according to Equation (
6). Note that when the battery is idle,
Pcharge,t =
Pdisch,t = 0 and the energy content remains unchanged.
The charging and discharging efficiencies depend on the current through the battery; however, for simplification they are assumed constant throughout the simulation. Furthermore, it is assumed that the efficiencies are equal and that they can be calculated based on the battery round-trip efficiency (
) [
2,
5,
7],
.
The available energy in time
t is controlled by the usable capacity as well as the minimum and maximum levels of the state of charge,
, where
and
are given as percentages. This is set to avoid overcharge or deep discharge. As seen in
Figure 3, the open circuit voltage of a lithium-ion battery is relatively constant in the SOC range of 10%–90%, so operation in this region is preferable. For this study, the battery voltage is assumed to be constant over the whole charge and/or discharge cycle.
As discussed in
Section 2.2, the battery deteriorates due to aging. As such, the usable capacity decreases with each time step according to the state of health:
, where
is given as the percentage of nominal capacity remaining in time
t. The resulting limits on the energy content are shown below:
The SOC and the energy of the battery are interdependent, and the SOC can be expressed as:
In addition, as previously mentioned, the SOC is limited to its minimum and maximum levels: . The DOD of the battery is dependent on the SOC, and vice versa, and it is defined as: .
2.7. Linear Programming
The objective function and most of the equations and constraints have linear relationships, making linear programming (LP) well suited to solve the optimization problem. It should be noted that some of the equations and constraints have been simplified in order to obtain a model which can easily be solved to find the optimal solution. In reality, these models of real life scenarios may be much more complex. Nevertheless, the simplifications can be justified as linear optimization provides unambiguous, repeatable results without requiring large computational efforts as compared to other optimization methods [
5].
The battery degradation model contains non-linear parts. Seeing as LP requires all equations and constraints to be linear, linearization needs to be applied. Referring to Reference [
13], the non-linear Equations (
2) and (
4) are linearized as follows: Equation (
2) is transformed into
and
, and Equation (
4) is transformed into
and
. However, there are still non-linearities in this model: when looking at
Figure 2, it becomes evident that there is a non-linear relationship between the DOD and the cycle life of the NMC battery. Seeing as the cyclic degradation,
, is defined as the inverse of the cycle life, Equation
and
contain non-linear parts and need to be further linearized.
In order to model the non-linear relationship between the cyclic degradation and DOD, piecewise linearization is applied to the inverse of
Figure 2: the curve is divided into
n linear segments, connected through
n + 1 points, as seen in
Figure 4. For a specific DOD value located between two points, the resulting degradation percentage is found based on the linear function of the segment connected by these two endpoints. In LP, this can be modeled by using special order sets of type 2 (SOS2). An SOS of type 2 is an ordered set of variables, where at most two variables can be non-zero for each time period. If two variables are non-zero, these must be adjacent. A linear model containing such sets becomes a discrete optimization model, even though the members of the set may be continuous. As such, a mixed integer linear optimizer is required to solve the problem [
24].
The piecewise linearization using SOS2 is done through:
,
and
, where index
i indicates point
i on the piecewise linear curve. Here,
degt,i represents the degradation,
dodt,i the depth of discharge, and
wt,i the SOS2 variable of point
i. The SOS2 property of having at most two non-zero variables which have to be adjacent, ensures that we are always on the piecewise linear function. This could also have been modeled using binary variables; however, special ordered sets are usually preferred as they may provide significant computational savings [
24].