# Energy Cost Minimization with Hybrid Energy Storage System Using Optimization Algorithm
## 3 Results
### 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 22: Results for the economic optimization method—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. 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 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. 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.