Next Article in Journal
The Economic Optimization of a Grid-Connected Hybrid Renewable System with an Electromagnetic Frequency Regulator Using a Genetic Algorithm
Previous Article in Journal
Distribution Network Situational Awareness Prediction Based on Spatio-Temporal Attention Dynamic Graph Neural Network
Previous Article in Special Issue
Impact of Farm Biogas Plant Auxiliary Equipment on Electrical Power Quality
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Article

Forecasting Short-Term Photovoltaic Energy Production to Optimize Self-Consumption in Home Systems Based on Real-World Meteorological Data and Machine Learning

by
Paweł Kut
1,* and
Katarzyna Pietrucha-Urbanik
2,*
1
Department of Heat Engineering and Air Conditioning, Rzeszow University of Technology, Al. Powstancow Warszawy 6, 35-959 Rzeszow, Poland
2
Department of Water Supply and Sewerage Systems, Faculty of Civil, Environmental Engineering and Architecture, Rzeszow University of Technology, Al. Powstancow Warszawy 6, 35-959 Rzeszow, Poland
*
Authors to whom correspondence should be addressed.
Energies 2025, 18(16), 4403; https://doi.org/10.3390/en18164403
Submission received: 2 July 2025 / Revised: 7 August 2025 / Accepted: 13 August 2025 / Published: 18 August 2025

Abstract

Given the growing number of residential photovoltaic installations and the challenges of self-consumption, accurate short-term PV production forecasting can become a key tool in supporting energy management. This issue is particularly significant in systems without energy storage, where excess production is fed back into the grid, reducing the profitability of prosumer investments. This paper presents an approach to forecasting short-term energy production in residential photovoltaic installations, based on real meteorological data and the use of machine learning methods. The analysis is based on measurement data from a functioning PV installation and a local weather station. This study compares three models: classical linear regression, Random Forest and the XGBoost algorithm. The method of data preparation, the model training process and the assessment of their effectiveness based on real energy production measurements are presented. This paper also includes a practical calculation example and an analysis of selected days in order to compare the forecast results with the actual production. Of the three models compared, the highest accuracy was achieved for XGBoost, with an MAE = 1.25 kWh, RMSE = 1.93 kWh, and coefficient of determination R2 = 0.94. Compared to linear regression, this means a 66% reduction in MAE and a 41% reduction in the Random Forest model, confirming the practical usefulness of this method in a real-world environment. The proposed approach can be used in energy management systems in residential buildings, without the need to use energy storage, and can support the development of a more conscious use of energy resources on a local scale.
Keywords: photovoltaic; forecasting; linear regression; random forest; XGBoost; energy optimization photovoltaic; forecasting; linear regression; random forest; XGBoost; energy optimization

Share and Cite

MDPI and ACS Style

Kut, P.; Pietrucha-Urbanik, K. Forecasting Short-Term Photovoltaic Energy Production to Optimize Self-Consumption in Home Systems Based on Real-World Meteorological Data and Machine Learning. Energies 2025, 18, 4403. https://doi.org/10.3390/en18164403

AMA Style

Kut P, Pietrucha-Urbanik K. Forecasting Short-Term Photovoltaic Energy Production to Optimize Self-Consumption in Home Systems Based on Real-World Meteorological Data and Machine Learning. Energies. 2025; 18(16):4403. https://doi.org/10.3390/en18164403

Chicago/Turabian Style

Kut, Paweł, and Katarzyna Pietrucha-Urbanik. 2025. "Forecasting Short-Term Photovoltaic Energy Production to Optimize Self-Consumption in Home Systems Based on Real-World Meteorological Data and Machine Learning" Energies 18, no. 16: 4403. https://doi.org/10.3390/en18164403

APA Style

Kut, P., & Pietrucha-Urbanik, K. (2025). Forecasting Short-Term Photovoltaic Energy Production to Optimize Self-Consumption in Home Systems Based on Real-World Meteorological Data and Machine Learning. Energies, 18(16), 4403. https://doi.org/10.3390/en18164403

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop