# Energy Cost Minimization with Hybrid Energy Storage System Using Optimization Algorithm
## 2 Materials and Methods  
### HESS Model  
The setup considered in this work was a scenario of a microgrid that is equipped with RES; in the presented case, this was in the form of a photovoltaic (PV) installation. The system was equipped with a behind-the-meter HESS as shown in Figure 1.  
Energy profiles were extracted from the historical data recorded by power analyzers at the KEZO Research Centre, Jablonna, Poland. The usage was gathered from 3 buildings, which had laboratories, conference rooms, kitchens, bathrooms, administration offices, hotel rooms and a server room. The annual consumption was around 221 MWh; it was characterized with irregular patterns of usage--there were long intervals with a very high level of usage, but also non regularly appearing peaks. The usage was variable, ranging from 10 kW to 60 kW, with two dominating values around 20 kW and 38 kW (Figure 2). The centre was equipped with PV installations amassing 180 kW in total, generating 144 MWh annually. The profiles of power generation and usage were aggregated in 15 min intervals, which is a commonly used interval of energy data gathering and it is consistent with the standard output of the energy meters. The usage and production aggregated per month is presented in Figure 3.  
The HESS installed and used in the KEZO power system and modelled in this work consisted of a vanadium redox flow battery (VRFB) and a lithium-iron-phosphate (LFP) battery. The parameters of HESS batteries used for simulations are given in Table 1. Generalized battery cost and performance (number of cycles, efficiency) data were based on [24]. The batteries were connected logically in one network and were managed by the EMS system installed on an industrial computer. Figure 1: The schematic model of the HESS operating in a microgrid. The model included linear battery degradation, which reflected the battery capacity loss during its usage and the cost of replacing the battery block (\(ReC_{i}\)) after exceeding nominal energy throughput (\(Th_{i}\)). To evaluate depreciation cost of operating the battery, the degradation cost was calculated by multiplying discharge energy by a degradation cost factor (DCF). This factor was calculated as follows for each of the batteries (i--index of each battery in the HESS):  
\[DCF_{i}=ReC_{i}/Th_{i} \tag{1}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Parameter** & **Symbol** & **Unit** & **VRFB** & **LFP** \\ \hline Installed capacity & \(E_{bol}\) & kWh & 100 & 54 \\ \hline Max. continuous power & \(P_{max}\) & kW & 15 & 32 \\ \hline Allowed depth of discharge & \(DoD\) & \% & 100 & 80 \\ \hline Nominal number of cycles & \(NoC\) & - & 5200 & 2000 \\ \hline Round trip efficiency & \(RTE\) & \% & 68 & 86 \\ \hline Battery block replacement cost & \(ReC\) & PLN/system & 166,000 & 60,750 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Hybrid energy storage system parameters assumed for the simulation. Figure 3: The energy of usage and production aggregated by month (data from the KEZO Research Centre). Figure 2: The histogram of power of consumption in the used example in KEZO Research Centre. where:  
\[Th_{i}=NoC_{i}*(DoD_{i}*E_{bol,i}) \tag{2}\]  
The \(Th_{i}\) is the nominal throughput of the storage calculated as the multiplication of number of cycles (\(NoC\)), depth of discharge (\(DoD\)) and the nominal capacity (\(E_{bol}\))--the values for the considered setup are presented in Table 1.  
The battery model also accounted for energy losses in the batteries. At the battery charging instants, a round trip efficiency (\(RTE\)) factor was applied to calculate the energy available for discharge. For the sake of model simplification and reduction of computational burden, efficiency and degradation remained independent of the battery's operational parameters, such as temperature, current and \(DoD\). The model was simulated with up-to-date Polish market prices in tariff B23, which is a real tariff for this type of building and usage.