{'fraction_non_alphanumeric': 0.028792815003962312, 'fraction_numerical': 0.011006427753808223, 'mean_word_length': 4.896936656282451, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Improving optimal control of grid-connected lithium-ion batteries through more accurate battery and degradation modelling

The increased deployment of intermittent renewable energy generators opens up many new opportunities for grid-connected energy storage. Batteries offer significant flexibility compared with most other storage technologies, but are relatively expensive. The lifetime of the battery is a key factor in the business case. The lifetime depends on how the battery is used, but most techno-economic analyses do not account for this. Here, three lithium-ion battery dynamic and degradation models of increasing realism are formulated, and the predicted degradation of each is compared with a large-scale experimental degradation data set (Mat4Bat). A respective improvement in RMS capacity prediction error from 11% to 5% is found by increasing the model accuracy. The three models are then used within an optimal control algorithm to perform price arbitrage over one year, including degradation. Results show that the revenue can be increased substantially while degradation can be reduced by using more realistic models. The estimated best case profit using a sophisticated model is a 175% improvement compared with the simplest model. This illustrates that using a simplistic battery model in a techno-economic assessment of grid-connected batteries might substantially underestimate the business case and lead to erroneous conclusions.


Introduction
Challenges for the electricity system arise due to increasing deployment of intermittent renewable energy sources [1]. For example, balancing production and demand becomes more difficult, grid inertia decreases, and distribution grids become more congested. As part of a broad portfolio of possible solutions, battery energy storage provides a flexible option to address many of these problems. However, the lifetime of a battery in terms of capacity and power capability strongly impacts the profitability of battery storage [2].
The lifetime of a lithium-ion (li-ion) battery depends on how it is used because there are multiple degradation mechanisms, each influenced by different usage patterns [3].
Many previous economic assessments of storage have included a battery degradation model, usually an empirical correlation based on fitting of measured degradation tests e.g. [2,4,5]. Although empirical models can provide valuable insight, they should be used with caution [6,7]. They are based on a limited number of test conditions and do not necessarily apply to other load profiles, risking extrapolation without theoretical basis. Furthermore, battery characteristics change as batteries age, which is often not taken into account.
Finally, empirical models only apply to the exact type of cell for which they have been developed.
A few researchers have used electrochemical models to address these issues, and initial results are promising: a more intelligent battery utilisation informed by a physical model could decrease battery degradation [8]. Lawder et al. [9] compared battery models for a simple micro-grid application (ignoring degradation) and noted how accumulated errors in equivalent circuit battery models led to substantial discrepancies between the simulated and real state of charge (SoC). Multiple researchers, e.g. [10], used electrochemical battery models to optimise charging profiles, increasing battery life.
These cases studies showed the potential for using electrochemical battery models to improve the lifetime and therefore the economic impact of grid connected batteries. However, to our best knowledge, due to the complexity of these nonlinear battery models, they have not been used for optimisation over a long time horizon (e.g. a year), yet this is required to truly quantify their performance. Therefore, this paper aims to identify the economic performance gains achievable by using a nonlinear, electrochemical battery model, including degradation, in an economic optimisation for a realistic grid application over a full year of data.   3. Methods

Problem setup
In this simulation study, a lithium-ion battery was used for price arbitrage. In other words, revenue was made by buying energy on the wholesale market when prices were low, charging the battery, and then selling energy on the market at higher prices at a later point, discharging the battery. However, usage of the battery also resulted in capacity fade. The task of a battery operator who wishes to exploit this market is to identify a load profile which maximises revenue and minimises lost capacity. For price data we used the wholesale price of the Belgian day-ahead electricity market in 2014, shown in Figure 1, where the colour indicates the price at each hour (y-axis) of each day (x-axis). The price was assumed to be known perfectly, leading to a deterministic optimisation problem, described below.
A generic optimal control formulation was used to describe this problem mathematically (1)(2)(3)

Battery models
One cell with a capacity of 2.7 Ah was simulated with three commonly used battery models shown in lifetime was assumed to reach its end of life after 8000 full cycles when 20% of the capacity has been lost, leading to a degradation factor of 1.25E −5 per energy throughput (7). To ensure a constant power level as long as the price is constant, a small penalty for the maximum power level was introduced. The degradation cost C was the product of the lost capacity and the cost of degradation (8).
C (u (t) , x (t)) = E lost,Wh λ degrad,W h N Equivalent circuit model. In a more complex model, a battery was represented by the electrical circuit shown in Figure 2b. The control variable u is the current to/from the battery I. There are two state variables x : the state-of-charge z and the current through the parallel resistor I r . The state-space model f consists of two equations (9-10) [13]. The voltage may be calculated using Ohms law (11). There are four constraints g (12-13). The revenue per unit of time R is the product of the power and the price (14). The estimated degradation is based on the empirical degradation formula by Schmalstieg et al. [14] (15), which is a function of the simulation time, the charge throughput and the charge capacity of the battery. Within this model, the variable α is a function of the mean voltage and the temperature, while β is a function of the root mean square voltage and the average deviation from the mean SoC (given by 2 ). This SoCdeviation was used to approximate the depth of discharge in the original equation by Schmalstieg et al. The degradation cost C was calculated according to equation (16).
Single particle model (SPM). The SPM [15] is one of the simplest electrochemical battery models; electrolyte transport is ignored, and only electrode transport is modelled. Each electrode is represented by one sphere in which lithium ions diffuse according to Ficks law of diffusion, as shown in Figure 2c. Chebyshev collocation was used to discretise the spatial derivative of the diffusion equation [7] in our implementation of the model.
At the surface, li-ions react according to Butler-Volmer reaction kinetics. The SPM was extended with a lumped thermal model [16] and with a parasitic side reaction consuming cyclable li-ions in order to grow a passivating layer (the solid electrolyte interphase, or SEI) on the graphite electrode, thereby decreasing the cell capacity [17]. The SEI layer grows both during rest and on cycling. Its growth is enhanced by 6 high temperature, high state of charge and high power charge. The resulting model was similar to other single particle models used often by battery researchers to predict battery degradation, e.g. [8,18,19]. The control variable u is the current to/from the battery I, and there are 13 state parameters x : the lithium concentration at the 5 Chebyshev nodes in each electrode, the battery temperature, the thickness of the SEI layer and the amount of li-ions consumed by the growing SEI layer. The state space model equations f are given in the appendix. There were four constraints g (17)(18). The revenue per unit of time R was calculated similarly as for the other models (19). The degradation cost C was the product of the loss of li-ions at the end of the simulation time, the cost of lost lithium inventory and the number of cells (20).
All three of the aforementioned battery models used a slightly different cost of battery degradation. The bucket model used the cost of battery energy degradation λ degr,Wh , which was set at 0.33 about 450 $ (kWh) −1 in 2014 [20]. The equivalent circuit model used the charge degradation cost λ degr,Ah , which was set to 1.2 A C (Ah) −1 by assuming an average voltage of 3.64 V. The single particle model used the cost of lost lithium inventory. It has been shown that the lost charge capacity is not the same as the lost lithium inventory in a real battery [21]. In our simulations with the single particle model, the lost lithium was calculated explicitly. The capacity was measured by simulating a full charge and discharge, similar to the way it is measured in experiments. The lost capacity is the difference between the result of this and the initial battery capacity. Comparing the lost capacity and lost lithium showed that they are very similar, probably because no loss of active material is included in our model here. Therefore the price of lost lithium inventory λ degr,LLI was also set at 1.2 A C (Ah) −1 , where the Ah is the lost lithium.

Optimisation algorithm
The bucket battery model is input-output linear, and hence long time periods can be simulated easily, explaining its widespread use. Standard linear solvers were used.
The equivalent circuit battery model is linear apart from the open circuit voltage curve OCV(z(t)) and the degradation cost C. The nonlinear optimisation techniques described below for the single particle model worked for this battery model too, and due to the nonlinearity only being in the output equation, and the low order of the model, the optimisation was about 10 times faster than the single particle model (but over 1000 times slower than the bucket model).
The single particle model is a higher order model consisting of nonlinearly coupled nonlinear partial differential equations and optimisation is more challenging. As a prerequisite, the model has to be formulated with the optimisation in mind. The spatial Chebyshev discretisation used (see section 3. This approach resulted in a set of (nonlinear) algebraic constraints linking the optimisation variables at different points in time. Then IPOPT [23], a gradient-based nonlinear optimisation package, was used to maximise the profit. The limited-memory quasi-Newton method was used to approximate the Hessian of the Lagrangian. MUMPS [24] and HSL [25] were used as linear solvers. Automatic differentiation performed by ADOL-C [26] and its sparse drivers ColPack [27] was used to calculate the derivatives needed by IPOPT.

Sliding window optimisation
With the previous optimisation techniques, the single particle model could be optimised for periods of several weeks relatively fast: it took about 6 hours to optimise a period of one week at a time resolution of 5 seconds; involving 10752 optimisation variables. To simulate longer periods, a sliding window approach was adopted (21)(22)(23)(24)(25)(26)(27). It was found that the size of the window affected the outcome only minimally beyond a size of one day. Therefore, a two day window was chosen as shown in Figure 3.
First, the battery utilisation was optimised for days 1 and 2 (22)(23)(24)(25). This yielded utilisation profiles for both days. The profile for day 1 was considered the optimal, while day 2 was included to account for end-effects (energy stored in the battery at the end of day 1 would have a value in the future) and hence the profile for day 2 was discarded (26). Then, the battery state at the end of day 1 was taken as the start point for the second optimisation (27) as indicated by the stars on in for n = 0 to 364 (21) Subject to (23) dx U opt (24n to 24(n + 1) − 1) = U opt n (0 to 23) x n+1 (0) = x n (24)

Post processing
The outcome of the optimisation is the optimal current at each point in time for each battery model.
However, this current might be infeasible in a real battery of the same capacity because it would result in under-or over-charging. For example, the optimal profile for the bucket model typically includes a high power input current until the battery is fully charged. But in a real battery this would lead to overcharging due to diffusion delays, overpotentials, resistive voltage drops, etc. Therefore, the battery in this scenario had to be 'oversized' to use the optimal profile, or alternatively the capacity of the bucket model had to be decreased in order to introduce safety margins to guarantee a current that would be safe for a real battery.
This second approach was followed.
Due to time constraints, in the absence of experimental tests, the single particle model, described previously, was used here as our 'real battery' for validation purposes. First, the optimal current was given as the input to the SPM which calculated the battery voltage. If this voltage exceeded the safety limits, the optimal current was scaled-down. The battery started at 50% SoC, so scaling down the current meant the battery stayed closer to 50% SoC, avoiding under-and overcharging. The single particle model was then also used to estimate the 'real' lost capacity corresponding to the optimal (down-scaled) currents. The capacity at a certain point in time was measured by simulating a full charge/discharge cycle at low current starting from the battery state at that point in time as explained in section 3.2. The decrease in capacity, multiplied by the cost of battery degradation λ degr,Ah , gave an estimate for the degradation cost.

Accuracy of battery degradation models
Within the Mat4Bat project [28]   However, the major trends are predicted better than the other two models. Table 1 summarises the accuracy of the three models. They were tested against data from the Mat4Bat project, as shown in Figure 4, and the data reported by Schmalstieg et al. [14]. This allows a fair comparison between the single particle model, which is calibrated for the Mat4Bat data, and the equivalent circuit model, which is calibrated for Schmalstiegs data. The equivalent circuit model is quite accurate except compared with the Mat4Bat cycle data. As noted above, this is due to extrapolation of the experimental outcomes without theoretical basis. The single particle model has the lowest average root mean square error in battery capacity prediction, which decreased from 11% (of initial capacity) for the bucket model to 5% (of initial capacity) for the single particle model.

Optimal battery utilisation for arbitrage
Having established a comparison between the degradation modelling approaches and experimental data, we now turn to optimal control of grid connected batteries. The optimisation was carried out twice for each battery model, once maximise the revenue, and in the second case to maximise total profit (revenue minus degradation cost), in order to assess the impact of co-optimising for degradation. These six optimal control profiles were validated with the single particle model as described in section 3.5. A close-up of the first week of each validated optimal profile is shown in Figure 5. When degradation is taken into account (dashed lines), the battery is used less. Depending on the formula used to estimate the degradation, the optimal profiles will use the battery less in different ways.
The bucket degradation model minimises the energy throughput and the maximal power. The equivalent circuit degradation model will push the SoC as close as possible to the SoC that minimises calendar ageing and minimise the charge throughput. The single particle degradation model will decrease the SoC and avoid high-power charging. As mentioned before, the empirical degradation formula identified by Schmalstieg [14] and used with the equivalent circuit model, overestimates initial degradation because of the square root dependency on charge throughput. Even if it was decreased by a factor of 5, it still overestimated the degradation cost, reducing battery utilisation far more than the 'real' optimum, to almost nothing. Figure 6 shows the battery state of charge at every hour of every day for each optimisation. The same two trends can be identified as on Figure 5: more capacity can be accessed by more accurate models and optimising profit reduces utilisation. In Figure 6d, showing the result for the profit maximising with the equivalent circuit model, it can be seen that the battery utilisation increases later in the year, when the predicted degradation curve starts to flatten, decreasing the predicted degradation and hence increasing the battery utilisation. The equivalent circuit model can access more capacity, increasing the revenue. However, in the case of maximising profit, overestimated degradation (even if divided by a factor of 5) highly reduced the optimal utilisation, decreasing revenue (and degradation) to low levels. This is discussed in the next section. The single particle model can access the full battery, increasing revenue. Even when degradation is taken into account, and battery utilisation is reduced, the revenue stays high. Table 2 summarises the performance of the 6 optimisation scenarios. It shows the revenue, degradation cost and profit at the end of the year, as well as the relative capacity the battery has lost during the year as predicted by the single particle model. As expected, the lost capacity is lower if degradation is included in the optimisation. For the bucket and single particle battery models, this also increases profit.     Although the simulated degradation might not exactly correspond to actual degradation (see Figure 4), major improvements can still be expected by accounting for degradation.

Discussion
Two important limitations arise from using the single particle model for the validation. The estimated lost capacity from Figure 7 and Table 2 might be slightly wrong because only one degradation mode is included in the single particle model while there are many others (so degradation at low SoC, high power levels, low temperatures, etc. will be underestimated). Secondly, the single particle model gets an artificial advantage over the other models because the same model is used for optimisation and validation, while the other optimisations have a different model for optimisation versus validation. But given the relatively good accuracy of the model ( Figure 4) against a large real experimental degradation data set, and the large performance difference, the general trends will most probably be valid in reality.
Because our optimisation does not consider the entire time horizon (see section 3.4), the two-day optimisation time horizon limits long-term effects e.g. decreasing future revenue as the capacity available in the future decreases due to current the battery capacity fade. Especially for the equivalent circuit model, this is problematic. The empirical degradation formula predicts a high initial degradation, which flattens out later in the battery life. Counter-intuitively, this means that using the battery early in its life has a positive impact by reducing degradation rate later in its life. But the 2-day window is too short to capture this effect, leading to suboptimal outcomes. Therefore, the equivalent circuit model probably performs better if a whole year is optimised at once because then this positive effect can be captured.
The decrease in battery degradation by maximising profit instead of revenue is about 80% for the single particle optimisation, which is in line with other reported results. Pathak et al. [10] optimised an electrochemical battery model for a short period of time and for another application (fast charging). They repeated the same pattern hundreds of times and found that degradation could be decreased by well over 50%. Patsios et al. [8] used a single particle model in a peak-shaving application. By running multiple (manually set) battery controls, they concluded battery degradation can be reduced by over 40%. A full-scale optimisation should outperform this heuristic approach, so a reduction of 80% seems realistic.

Conclusions
In this paper, three dynamic battery and degradation models with increasing complexity were described, along with three different ways to model battery degradation. The accuracy of the models was tested by comparing them with a large degradation data set. The increase in model complexity improved overall accuracy, reducing the root mean square error in predicted capacity fade from 11% to 5%.
The battery models were optimised for the same grid application (price arbitrage on the wholesale electricity market). It was found that, the more accurate the battery model, the more battery capacity could be used due to decreasing safety margins, increasing revenue by up to 42%. More complex degradation models decrease degradation by up to 80%, but this might decrease the overall profit by reducing the battery utilisation too much because degradation is overestimated in some scenarios. It is crucial to include all the necessary terms in the degradation model because the optimisation only minimises the terms explicitly present.
The more complex and accurate models are nonlinear and require small time steps for stability, posing significant computational complexity challenges for the optimal control problem. The models have to be designed with optimisation in mind. In the case of the single particle model, Chebyshev discretisation was used instead of finite differences to reduce the number of state variables. If simultaneous discretisation in space and time is used, multiple shooting has to be used to reduce the overall number of optimisation variables. Even then, the optimisation still involves several thousands of variables.
The total simulated profit increased by 175% from the simplest to the most complex model. Real battery degradation might differ from the simulated degradation here, but still major improvements can be expected by increasing model accuracy. This clearly illustrates that techno-economic assessments for gridconnected storage could under-or over-estimate the batteries' potential, depending on how they account for safety margins in their sizing approach, and miss important issues such as degradation, because they almost exclusively use the simplest and least accurate battery models.