*3.3. Modified Economic Optimization*

To deal with the problem of single-day optimization, a modification is proposed—the optimizer does not care about the state of charge of the battery at the end of the day, but for the next day it would be generally beneficial to have a higher state of charge, especially when there is a surplus of production that could have been used. To implement that, an extra rule was enforced after the optimization stage: when there is surplus of energy from the renewable sources, the battery will always try to use as much of this surplus as possible to charge. This modifies the solution returned by the solver in a way that the energy storage reaches the full state of charge faster and more often, which, in consequence, causes an increased state of charge of the energy storage at the end of the day. For the following day, the optimizer will be given this raised state of charge to start its calculations. We tested the solution and present the outcome on the following graphs—Figures 23–29. Figure 23 presents the monthly aggregated data—the increase in the operation of the energy storage in the summer months is clearly visible in comparison with the optimization method without modification. What is more, the import of energy has decreased, and, as a consequence, the cost of imported energy is also lower.

The more detailed view of each month gives a much better picture of the actual performance. In January (Figure 24), there are no changes in comparison to the optimization method as there is no surplus of energy.

For the summer months, the differences are much more visible; the graph for July shows the reduction in import and export of energy from and to the grid (Figure 25a). The batteries are charging and discharging more (Figure 25c) and the cost of energy import has dropped (Figure 25d). In this case, the difference between the energy balancing method and the modified economic optimization is very small and is mainly caused by small oscillations of the solutions given by the optimizer when it failed to reach the optimum solution in the defined number of iterations.

In July, the increase in the amount and duration of the charging of both batteries is visible. More of the surplus from the PV production is used. By the end of the day, the state of charge of the VRFB is higher in comparison to economic optimization (Figure 26).

**Figure 23.** Results for the economic optimization method with modifications, aggregated monthly: (**a**) grid energy balance, (**b**) energy usage and production (input data), (**c**) activity of the energy storage, (**d**) cost of purchased energy and profit for sold energy.

**Figure 24.** Results for the economic optimization method with modifications—data for the month of January, aggregated per day: (**a**) grid energy balance, (**b**) energy usage and production (input data), (**c**) activity of the energy storage, (**d**) cost of purchased energy and profit for sold energy.

The operation on 4 October (Figure 27) and 6 February (Figure 28) is almost the same as in the economic optimization without modifications.

The economic indicators show very interesting changes—the modification is reducing the use of the energy from the evening peak tariff, decreasing the overall energy costs for the facility and increasing the savings from the PV production and the operation of the HESS. The differences are not very significant, but the improvement is very clear, albeit only in summer months.

**Figure 25.** Results for the economic optimization method with modifications—data for the month of July, aggregated per day: (**a**) grid energy balance, (**b**) energy usage and production (input data), (**c**) activity of the energy storage, (**d**) cost of purchased energy and profit for sold energy.

**Figure 26.** Results for the economic optimization method with modifications—data for 27 July: (**a**) grid power balance, (**b**) energy usage and production (input data), (**c**) batteries power, (**d**) batteries state of charge.

**Figure 27.** Results for the economic optimization method with modifications—data for 4 October: (**a**) grid power balance, (**b**) energy usage and production (input data), (**c**) batteries power, (**d**) batteries state of charge.

**Figure 29.** Results for the economic optimization method with modifications—monthly economic indicators: (**a**) purchase cost classified by tariff zones (tariff prices), (**b**) costs, profits and financial balance, (**c**) costs of energy saved by PV generation, (**d**) costs of energy saved by HESS operation.

#### **4. Discussion**

The overall aim of this work is to present an economic optimization algorithm for hybrid energy storage that will improve the financial outcome of the setup and show that the hybrid energy storage is a feasible solution to improve the self-consumption of energy from PV installation. The results of the simulations for the benchmark and the proposed HESS control strategies are summarized in Table 2.

The first part of the table focuses on the energy between the facility and the power grid. The batteries generally decrease the import and export of energy; the energy balancing approach is the most limited, due to the fact that it only operates on the surplus of the energy produced by the PV installation. The economic optimizations are realizing arbitrage all year round—buying energy when it is cheap and using it during peak times. The self-consumption rates are interesting—this is the percentage of the energy produced by the PV installation that was used within the installation, which show that, thanks to the batteries, over 77% of the produced energy is either directly consumed or stored for later

use. The difference between the storage management methods in this context is very small, which shows that any storage increases the use of energy from PV and that the optimization algorithms are rationally using the surplus from the PV production.


**Table 2.** Comparison of the control methods and the setup without storage.

The second section of Table 2 presents the costs of import and profit from the export of energy. Although profits from exports are clearly correlated with the self-consumption rate, the cost of imports are affected by the cost in tariff zones. Here, the energy balancing method has the highest cost but uses the lowest amounts of import, which clearly demonstrates that economic optimization methods manage to shift energy between the zones.

The subsequent section presents the summary of the batteries' operation. Battery charge and discharge energy is accumulated over the year to estimate the annual throughput and calculate energy losses. Equivalent cycles are calculated using discharge energy, nominal capacity and *DoD*. This, in turn, is used to estimate the lifetime of each battery within HESS, allowing the estimation of the point in the investment horizon that replaces the battery blocks. The economic optimization approaches make much more use of the energy storage, and thus also shorten its lifetime.

The financial outcome accounts for energy trading costs (which include battery losses) and for the depreciation of each battery (to account for the cost of battery block replacement at the end of the expected battery lifetime). For comparison, the values of financial outcome without depreciation costs was presented as this better shows how much the depreciation of the battery costs.

Energy balancing uses every opportunity to charge batteries with surplus generation that would be exported otherwise. As soon as the load is larger than generation, stored energy is used to supply loads. Energy balancing does not cycle batteries at all in winter time, when the PV installation does not generate surplus energy. It can be assumed that a single battery performs on average one cycle every two days. As a result, the balancing algorithm generates almost no cost savings in the winter months when the HESS stays in an idle state.

By contrast, the economic optimization methods leads to heavy balancing of the batteries, resulting in the shortening of the expected lifetime. Additional cycles are caused by the fact that cost optimization implies time-of-use strategy that charges a battery in an off-peak tariff to use it during peaks. This results in increased energy losses and battery depreciation. The advantages of including time-of-use strategy are seen in the financial outcome. Figures 21 and 29 confirm that the majority of energy consumed is drawn from the grid in the off-peak tariff. The HESS leads to cost savings all year round.

The optimization method has another significant advantage over the balancing algorithms that was not reflected in the costs: it results in the operation of the LFP battery with relatively lower power. This leads to operation of the battery at lower temperature, and thus to an increased lifespan. This phenomenon has not been captured by the model applied but is an important point to investigate in future works.

The modification of the optimization method was introduced to partly overcome the problems connected to optimizing in 24 h windows. This 24 h window limits the horizon of the optimizer to the end of the day, and as such the optimizer is unable to increase the state of charge of the HESS, even if this would be beneficial for the next day. The implemented modification improved the solution, but there might still be a slight improvement if the optimization was calculated using longer time windows.

In this work, we limited the calculations to a 24 h window because the optimizer was also intended to perform the on-line optimization for the continuous management of an energy storage using forecasts; reliable forecasts can, however, only be obtained for the next day. Additionally, we considered a single day time rational in the case of a setup with a PV installation. The calculations were performed on standard desktop computers (CPU i5 3.2 GHz, 16 GB RAM) and while the balancing algorithm calculation time was below a minute, the simulation of an entire year using the economic optimization methods took 24 h. There is no possibility to parallelize the computations for this simulation as the state of charge of the storage at the end of the day is an input for the next-day computation.

#### **5. Conclusions**

A valuable tool has been implemented to test, simulate and analyze the behavior of the modelled HESS with battery models. The tool integrates a techno-economical model of a microgrid, including loads and RES. The model includes two battery types with their respective round trip efficiencies and costs of depreciation related to battery degradation during cycling. This simulation tool facilitates the sizing of the HESS installation, as well as the development and testing of control algorithms for scheduling the HESS operation. The graphical interface allows easy provisioning of input data while also allowing a visualization and analysis of the output data. The authors have implemented HESS control methods, including a simple energy balancing algorithm and using an energy cost optimization. The model and methods have been tested with real energy profiles recorded at a research centre.

The results explain the difference between the tested methods. The simple balancing algorithm stores surplus RES energy in the HESS and increases self-consumption rate to reduce the cost of energy; it does not do arbitrage as such, as it does not care about prices or tariffs. The advantage of this algorithm is its simplicity and moderate financial outcomes–using energy storages with such an algorithm brings profits in comparison to the setup without storage. The disadvantage is that this approach relies on the surplus of RES energy, otherwise the batteries are not used at all. Such an algorithm can be profitable when the averaged production from RES exceeds the usage of the facility. The economical optimization method on the other hand minimizes the costs of the operation during a single day. It uses the fact that there is a sufficient difference in cost of energy in different zones of the tariffs–using batteries for arbitrage can become profitable.

The total cost of using the VRFB battery (taking into account depreciation cost and losses related to the round trip efficiency) is not compensated by the difference between the prices in morning peak and off peak tariff zones. Adding an LFP battery, which has different properties and therefor cost balance, allows for reducing usage in all price peaks. The combination of both batteries allow to improve the cost balance of the operation and prolong the lifetime of the batteries.

In the presence of overproduction of PV installation, the simple balancing algorithm at times outperformed the economical optimization method. The reason for this is that the methods employ a 24 h time window, during which the simple balancing algorithm tried to charge the battery as much as possible (it did not count the cost), whereas the economical optimization limited the charging to what was necessary for this day. This meant that in the economical optimization, a subsequent day might start with a lower SOC level, even though there was the potential to charge them the day before. To compensate for this, a modification of the economic optimization was performed, where the surplus of energy in a day was used to charge the HESS as much as possible. This modification improved the economical optimization method compared to the simple balancing algorithm.

The economical optimization method uses the HESS for arbitrage and, as a result, causes a more intense cycling of both batteries within the HESS. The simulation with realistic technical and economic data show that the arbitrage introduced by the economic optimization method has a small effect on the overall financial result. Although the energy consumption in the peak hours, and thus the energy cost, is reduced, there are additional costs of battery depreciation and energy losses in the batteries. The potential for energy price reduction comes at a cost—the final economic result is only slightly better than the simple energy balancing when the battery depreciation cost is included. It should be noted that the impact of leaving a battery in a discharged state, which happens during winter months in the simple energy balancing, is not considered in the model.

Obviously, the financial results depend on a variety of factors, such as battery performance and cost, energy usage and generation patterns and most of all energy price profiles. For this reason, future work includes analyzing different HESS operating scenarios and adjusting the optimization method to take into account additional services that the HESS can provide.

The designed methods will be tested in a real environment with forecasted profiles being the basis for the optimizer. What is more, we plan to test the optimizer on the prices from the day-ahead market, where both the purchase and selling prices are changing every hour. The tool is intended to be further developed into a commercial tool for ESS installation planning and management. The tool will be modified to work with the predictions of load and production rather than with historic data, then it will become a scheduler that can be used to manage the operation of the energy storage, together with a real-time controller.

**Author Contributions:** Conceptualization, supervision, funding acquisition, validation, K.R.; methodology, software, formal analysis, investigation, writing—original draft preparation W.R.; software, data curation, visualization, O.G.; supervision, resources, review and editing, H.B., writing—review and editing, J.V. All authors have read and agreed to the published version of the manuscript.

**Funding:** The work was financially supported by The National Centre for Research and Development via grant No. LIDER/30/0166/L-10/18/NCBR/2019.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
