## 4 Conclusions  
Renewable energy plays a crucial role in mitigating environmental issues associated with energy production. In recent years, the number of PV systems has been rapidly increasing. However, the biggest disadvantage of PV systems is that they are intermittent energy sources. For this reason, various problems are encountered in energy transmission lines and power systems. Depending on these problems, various capacity restrictions are applied for the connections of PV plants to transmission/distribution line transformers. The most effective way to overcome the capacity problems caused by grid-connected PV plants and to reduce the effects of these problems is to use battery systems. In this study, PV + ESS system sizing was carried out for a commercial building located in the Bolu province of Turkey. Data such as the hourly electricity consumption of the building, grid-to-load energy price tariff, system-to-grid energy tariff, solar radiation, and ambient temperature were analyzed in detail. In line with various target functions, the system was optimized under load consumption, ESS, and PV cost scenarios. Evaluation indicators were considered from various aspects, such as SCR, SSR, LCOE, NPV, and PBP. The objectives, methods, tariffs, and effects of time analysis for optimizing PV + ESS system capacity were summarized. The proposed model provides a sustainable, economical, and environmentally friendly solution to reduce the negative impacts of PV systems on the grid. The results show that a significant amount of clean energy can be produced and stored with an LCOE of USD 0.1467/kWh and an NPV of USD 4918.3 in the first year of operation. In addition, the annual efficiency of the ESS was calculated as 83.6%, the total energy input to the battery was determined as 461,357 kWh/year, and the energy used from the battery was determined as 403,568 kWh/year. The distribution of the energy generated from the PV system was as follows: 24.25% was used to feed the load, 50.6% was directed to the ESS, and 25.14% was used to be sold to the grid. These results show that the optimized ESS sizing is effective in increasing self-consumption and minimizing grid dependency. This study provides significant contributions to the literature on the optimization of PV + ESS systems. While battery capacity was generally determined over fixed load profiles in previous studies, system performance was improved in this study using real-time measurement data and dynamic optimization methods. The results obtained reveal that the battery optimization method used provides advantages in terms of economic gain and increases energy independence. The developed methodology can be applied to energy systems with different climate conditions and grid structures. In the future, a more comprehensive analysis can be made by considering different load profiles, battery technologies, and energy price variables.  
Conceptualization, M.T.O. and G.B.; Methodology, K.B., M.T.O. and G.B.; Software, K.B., M.T.O. and G.B.; Validation, K.B., M.T.O. and G.B.; Formal analysis, K.B., M.T.O. and G.B.; Investigation, K.B., M.T.O. and G.B.; Resources, K.B., M.T.O. and G.B.; Data curation, K.B., M.T.O. and G.B.; Writing--original draft, K.B., M.T.O. and G.B.; Writing--review & editing, K.B., M.T.O. and G.B.; Visualization, K.B., M.T.O. and G.B.; Supervision, K.B.; Project administration, K.B. All authors have read and agreed to the published version of the manuscript.  
This study was financially supported by Firat University with FUBAP-MF.24.125. And this study was supported by the Scientific Research Projects Coordination Unit of Firat University. Project number MF.24.125.  
Data is contained within the article. Additional data supporting the findings of this study are available from the corresponding author upon reasonable request.  
Authors thank to the support by Firat University with FUBAP-MF.24.125.  
The authors declare no conflicts of interest.