# Algorithm for Increasing Accuracy of Solar Power Forecasting When Applying Nearest Neighbor Method

## Authors

• Ye. V. Sedlіarov National Technical University of Ukraine “Igor Sikorsky Kyiv Polytechnic Institute”, Kyiv, Ukraine
• K. S. Klen National Technical University of Ukraine “Igor Sikorsky Kyiv Polytechnic Institute”, Kyiv, Ukraine

## Keywords:

nearest neighbor method, power forecasting, clustering, solar energy, solar irradiation, regression

## Abstract

This paper presents the prediction of the output power of a solar power plant based on the nearest neighbor regression method. Data from a 50 MW solar power plant in China with solar radiation, ambient temperature, pressure, and humidity values and corresponding output power values from 01/01/2019 to 12/31/2020 with 15-minute intervals were used to create the output power forecast. Before using the data, they were cleaned of outliers using the standard interquartile range method, data points were divided into test and training groups, and feature scaling was applied using the standardization method to correctly calculate the Euclidean distance between data points. The application of clustering of weather parameters by the k-means method is proposed, which allows for individual selection of the number of neighbors for each cluster and to exclude the influence of points of one cluster on the number of neighbors of another cluster. The number of clusters is selected by determining the silhouette coefficient, the training group of weather parameters with their corresponding output power values is distributed among clusters based on the Euclidean distance to the centroid of the clusters. The test group of weather parameters is divided into clusters, after which forecasting by the method of nearest neighbors takes place within each cluster separately. The output power of the solar power plant is calculated as the weighted arithmetic average of the neighbors of each point of the test group. At the end of the algorithm, the sequence of points of weather parameters of the test group is restored and a time series of the output power forecast is created. The proposed algorithm made it possible to reduce the MSE, RMSE, MAPE, MAE forecast errors for 1 day by 0.5348, 0.2265, 0.38%, 0.1448, respectively, for 7 days, the errors became smaller by 0.1992, 0.0384, 0.1%, 0.0193, respectively. As a result, the relative error in forecasting for 24 hours is 4.22%.

## Author Biographies

### Ye. V. Sedlіarov , National Technical University of Ukraine “Igor Sikorsky Kyiv Polytechnic Institute”, Kyiv, Ukraine

student of the Department of Electronic Devices and Systems, Faculty of Electronics

### K. S. Klen , National Technical University of Ukraine “Igor Sikorsky Kyiv Polytechnic Institute”, Kyiv, Ukraine

Associate Professor at the Department of Electronic Devices and Systems, Faculty of Electronics

## References

References

Paris Agreement. Treaty Series (2015). United Nations, Vol. 3156, Registration: 4 Nov. 2016, № 54113. ENVIRONMENT, Cham. XXVII 7 D, pp. 1-8.

European Commission, Secretariat-General (2019). Communication from the Сommission to the European parliament, the European council, the council, the European economic and social committee and the committee of the regions. The European Green Deal. An official website of the European Union, Document 52019DC0640.

Renewable capacity statistics (2023). International Renewable Energy Agency.

Iheanetu K. J. (2022). Solar Photovoltaic Power Forecasting: A Review. Sustainability, Vol. 14, Iss. 24, 17005. doi:10.3390/su142417005.

Raza M. Q., Nadarajah M., Ekanayake C. (2016). On recent advances in PV output power forecast. Solar Energy, Vol. 136, pp. 125-144. doi:10.1016/j.solener.2016.06.073.

Antonanzas J., Osorio N., Escobar R., Urraca R., Martinez-de-Pison F. J., Antonanzas-Torres F. (2016). Review of photovoltaic power forecasting. Solar Energy, Vol. 136, pp. 78-111. doi:10.1016/j.solener.2016.06.069.

Klen K. S., Zhuikov V. Y. (2020). Vplyv stokhastychnoho kharakteru enerhii v systemakh rozoseredzhenoi heneratsii na yikhniu stiikist [Influence of stochastic nature of energy in distributed generation systems on their stability]. Technical Electrodynamics, Vol. 3, pp. 62-68. doi:10.15407/techned2020.03.062.

Santiago I., Trillo-Montero D., Moreno-Garcia I. M., Pallarés-López V., Luna-Rodríguez J. J. (2018). Modeling of photovoltaic cell temperature losses: A review and a practice case in South Spain. Renewable and Sustainable Energy Reviews, Vol. 90, pp. 70-89. doi:10.1016/j.rser.2018.03.054.

Poddar S., Evans J. P., Kay M., Prasad A., Bremner S. (2023). Assessing Australia’s future solar power ramps with climate projections. Scientific Reports, Vol. 13, 11503. doi:10.1038/s41598-023-38566-z.

Wellby S. J., Engerer N. A. (2016). Categorizing the Meteorological Origins of Critical Ramp Events in Collective Photovoltaic Array Output. Journal of Applied Meteorology and Climatology, Vol. 55 , Iss. 6, pp. 1323-1344. doi:10.1175/JAMC-D-15-0107.1.

Zakon Ukrainy «Pro vnesennia zmin do deiakykh zakoniv Ukrainy shchodo vidnovlennia ta ``zelenoi'' transformatsii enerhetychnoi systemy Ukrainy» vid 30.06.2023 (№ 3220-IX) [Law of Ukraine On Amendments to Certain Laws of Ukraine on Restoration and Green Transformation of the Energy System of Ukraine]. Verkhovna Rada Ukrainy [Verkhovna Rada of Ukraine], data zvernennia: 27.10.2023.

Zakon Ukrainy «Pro rynok elektrychnoi enerhii» vid 13.04.2017 (№ 2019-VIII) Redaktsiiavid 03.09.2023 [Law of Ukraine On the Electricity Market]. Verkhovna Rada Ukrainy [Verkhovna Rada of Ukraine], data zvernennia: 27.10.2023.

Sobri S., Koohi-Kamali S., Rahim N. A. (2018). Solar photovoltaic generation forecasting methods: A review. Energy Conversion and Management, Vol. 156, pp. 459-497. doi: https://doi.org/10.1016/j.enconman.2017.11.019.

Myroshnichenko M. V., Klen K. S. (2022). Prohnozuvannia potuzhnosti na vykhodi soniachnoi paneli [Prediction of the Power of the Solar Panel]. Microsystems, Electronics and Acoustics, Vol. 27, Iss. 2, pp. 237737–1-237737-5. doi:10.20535/2523-4455.mea.237737.

Abdel-Nasser M., Mahmoud K. (2019). Accurate photovoltaic power forecasting models using deep LSTM-RNN. Neural Comput & Applic, Vol. 31, pp. 2727–2740. doi:10.1007/s00521-017-3225-z.

Zhang J., Verschae R., Nobuhara S., Lalonde J.-F. (2018). Deep photovoltaic nowcasting. Solar Energy, Vol. 176, pp. 267-276. doi:10.1016/j.solener.2018.10.024.

Li G., Xie S., Wang B., Xin J., Li Y., Du S. (2020). Photovoltaic Power Forecasting With a Hybrid Deep Learning Approach. IEEE Access, Vol. 8, pp. 175871-175880. doi:10.1109/ACCESS.2020.3025860.

Mayer M. J. (2021). Influence of design data availability on the accuracy of physical photovoltaic power forecasts. Solar Energy, Vol. 227, pp. 532-540. doi:10.1016/j.solener.2021.09.044.

Visser L., Lorenz E., Heinemann D., Wilfried G. J. H. M. van Sark (2022). 1.11 -- Solar Power Forecasts. Comprehensive Renewable Energy (Second Editoin), Vol. 1, pp. 213-233. doi:10.1016/B978-0-12-819727-1.00135-7.

Watanabe T., Takenaka H., Nohara D. (2021). Post-processing correction method for surface solar irradiance forecast data from the numerical weather model using geostationary satellite observation data. Solar Energy, Vol. 223, pp. 202-216. doi:10.1016/j.solener.2021.05.055.

Nespoli A., Niccolai A., Ogliari E., Perego G., Collino E., Ronzio D. (2022). Machine Learning techniques for solar irradiation nowcasting: Cloud type classification forecast through satellite data and imagery. Applied Energy, Vol. 305, 117834. doi:10.1016/j.apenergy.2021.117834.

Osypenko K. S., Zhuikov V. Ya. (2017). Otsinka fraktalnoi rozmirnosti ta peredavalnoi funktsii khmar [The evaluation of fractal dimension and transfer function of the clouds]. Microsystems, Electronics and Acoustics, Vol. 22, No 5, pp. 13-19. doi:10.20535/2523-4455.2017.22.5.106578.

Chen Y., Xu J. (2022). Solar and wind power data from the Chinese State Grid Renewable Energy Generation Forecasting Competition. Scientific Data, Vol. 9, Article number: 577. doi:10.1038/s41597-022-01696-6.

2024-03-30

## How to Cite

Седляров, Є. В. and Клен , К. С. (2024) “Algorithm for Increasing Accuracy of Solar Power Forecasting When Applying Nearest Neighbor Method”, Visnyk NTUU KPI Seriia - Radiotekhnika Radioaparatobuduvannia, (95), pp. 39-46. doi: 10.20535/RADAP.2024.95.39-46.