## 2 Experimental Setup and Proposed Method
### Battery Sizing and Modeling
Since overcharging and deep charging of the battery affects the battery life negatively, the maximum energy level of the battery is determined as small and equal to the maximum battery energy level, and the minimum energy level is determined as 20% of the maximum battery level. Lithium-ion phosphate batteries (LIPB) batteries are preferred in this study because they have features such as a high energy density, high nominal power, long cycle life, long discharge time, and high conversion efficiency [56]. The characteristic parameters of the battery used in this study are listed in Table 2.  
Integration of ESS into the PV system consists of the stages of data input, parameter processing, and optimization of the ESS. In the first stage, the energy generation values of the PV power plant and the demand energy values are processed. In the second stage, the operating situation of the power plant is simulated, and the operating strategy of the ESS is created, taking into account the technical characteristics of the batteries and the electricity price tariff. The ESS planning and solving process is illustrated in Figure 4.  
The primary purpose of integrating an ESS is to enhance self-consumption within the PV-battery system while ensuring energy continuity and maximizing economic benefits. Four strategies were used throughout the analyzed period to manage energy flows between PV, ESS, grid, and loads. * Strategy 1: Transferring the energy from the PV to loads and batteries and transferring the remaining energy to the grid. * Strategy 2: It is an economical operating mode in which batteries are charged at low grid electricity costs and discharged when higher electricity prices occur. * Strategy 3: This is the operating mode that aims to reduce peak demand and thus prevent voltage and frequency fluctuations in the electrical network. * Strategy 4: This is the operating mode in which a fixed charge/discharge rate is used based on the current state of charge of the batteries and historical PV generation and load consumption values. In line with the explanations above, the optimum ESS capacity was determined to be 130 kW with a 5-hour duration. This selection was based on a balance between energy demand, the PV production profile, and economic viability. The capacity was determined through an optimization process aimed at maximizing the own consumption of PV-generated energy while minimizing the dependency on grid electricity. Achieving energy balance is the main goal in planning any energy generation-consumption system. In addition, economic benefits must be kept at an optimum level while ensuring energy balance. Therefore, the cost function is also used in the objective function when managing the energy flow. The purpose of a cost function is to keep the energy unit cost of the energy generation system at a minimum level when it is costly to \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameters** & **Value** & **Unit** \\ \hline Batteryround-tripefficiency (\(\eta_{lb}\)) & 98 & \% \\ Charging/discharging efficiency (\(\eta_{cl}/\eta_{dis}\)) & 95 & \% \\ Self-discharge per day (\(\sigma_{sd}\)) & 0.02 & \% \\ Minimum SOC & 0.1 & - \\ Maximum SOC & 0.95 & - \\ Calendric life (\(L^{80\%}\)) & 15 & year \\ Cycle life (\(L^{80\%}_{cal}\)) & 10,000 & cycles \\ Coefficient of operation and maintenance & 1 & \% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The characteristic parameters of lithium-ion batteries [57]. Figure 4: The ESS planning flow chart. use energy from the grid. Grid energy is used to ensure energy continuity of loads when the energy of the PV + ESS system is insufficient or when the cost of drawing energy from the grid is cheap. The objective function is to ensure energy balance by considering the power transfer to the grid, SOC, and the constraints on the capacity of the PV plant and the ESS. Objective functions and constraints are provided in Equations (4)-(6).