# Energy Cost Minimization with Hybrid Energy Storage System Using Optimization Algorithm
## 3 Results
### Energy Balancing  
The first set presents the operation of the simple energy balancing algorithm. Figure 9 presents the performance indicators aggregated per month to give an overview of the whole year's operation. It is clearly visible that in winter months (November to February) the role of the production from photovoltaic is marginal and almost all of the produced energy is used for the self-consumption. In winter, the energy storage has no chance to charge as there is no surplus of energy. From March to October the activity of the energy storage is substantial, yet still, the storage is not able to completely rule out any purchase energy from the grid for June and July. Figure 9d represents the monthly aggregation of the energy bought and sold; in summer both can occur: sale and purchase can be present in the same month as one month can contain days when there is enough power from RES to cover the usage and sell, but the month can also contain days that might be too cloudy, making it necessary to buy energy. The more detailed view of each month gives a much better picture of the actual HESS performance. In Figures 10 and 11, the two different months are presented--January is the month with minimal energy storage activity, and July is the month when a surplus of produced energy allows the storage to cover the energy use in the evenings. On the 1 January, due to the initial settings of the simulation, the batteries are charged up to 50%, which causes the discharge of the battery immediately. In the other days in January, PV  
Figure 8: Monthly economic indicators for the setup without HESS or any other energy storage: (**a**) purchase cost classified by tariff zones (tariff prices), (**b**) costs, profits and financial balance. Figure 9: Results for the energy balancing method, 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. generation does not exceed the load, so there is no ESS activity. In July, however, the situation is much more interesting--there are days where there is no need to buy energy from the grid (Figure 10d), which shows the real usefulness of the energy storage. The following figures illustrate daily power profiles of the microgrid, including HESS. To fully illustrate behavior of control algorithms under different conditions, three days are chosen: 27 July with high PV generation (Figure 12), 4 October with medium PV generation  
Figure 11: Results for the energy balancing method—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 13) and 6 February with almost no PV generation (Figure 14). The dynamics of the different types of batteries are clearly visible--the VRFB has more capacity, which cannot be fully used due to its lower power. Very visible is the non-optimal behavior of immediately discharging the storage at the beginning of the day in case the batteries have not discharged during previous day. Night time is related to lowest energy prices, so such behavior is not economically justifiable. In October, the situation is similar to the summer time--there is still enough PV production that allows using both batteries to reduce the power exchange with the grid--first the VRFB is discharging, later the LFP takes over. Figure 14: Results for the energy balancing method—data for 6 February: (**a**) grid power balance, (**b**) energy usage and production (input data), (**c**) batteries power, (**d**) batteries state of charge. Figure 12: Results for the energy balancing method—data for 27 July: (**a**) grid power balance, (**b**) energy usage and production (input data), (**c**) batteries power, (**d**) batteries state of charge.