© 2025 The authors. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).
OPEN ACCESS
The prediction of solar power generation is essential for effective integration of renewable energy into power grids, aiding in grid stability, energy planning, and efficient resource allocation. Due to the inherent variability of solar energy caused by factors like weather patterns, time of day, and seasonal changes, machine learning (ML) has appeared as a powerful tool to improve forecasting accuracy. Solar panels with various tilt angle combinations are set up to collect experimental data. This paper uses regression learner technique in machine learning for solar power prediction. In this paper, linear regression and step wise linear regression algorithms are giving fruitful results compared to other algorithms. A detailed study of model selection is provided, alongside an examination of evaluation metrics such as Mean Absolute Percentage Error (MAPE), Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Means Square Error (RMSE), and R² scores. This study shows the effectiveness of ML in enhancing short, and medium-term solar power forecasting, supporting more efficient energy management and promoting the scalability of renewable energy systems. We obtained a regression coefficient (R2) of 1 and a MAPE of 0.7% and 0.45% for linear regression algorithm and stepwise linear regression algorithm respectively.
solar panel inclination, machine learning, linear regression, step wise linear regression
1.1 Solar PV power in Oman
As a part of Oman’s vision 2040, it develops renewable energy resources to establish sustainable energy in future. This diversifies Sultanate of Oman’s Energy mix and reduces the use of fossil fuels. The vast desert landscape of Oman has significant potential solar energy due to high solar irradiance levels [1]. There is more scope to generate solar power in Oman [2]. Solar power plays a vital role due to its geographical and climatic advantages. Solar energy is Clean and obtained from sun. Solar energy is abundantly available renewable energy and alternate to the fossil fuels [3]. The solar panels that have array of solar cells made up of silicon, phosphorous (source of negative charge), and Boron layers (source of positive charge) [4]. By using PV panels, sun’s light energy particles known as “Photons” are transformed into electricity to run the electrical equipment [5]. The atomic orbits liberate the electrons, and these free electrons are pulled by the electric field produced by the solar cells constitutes flow of direct current [6]. This solar energy can be obtained from solar PV cells by converting solar irradiance into electrical energy [7]. The solar panel efficiency is low and less than 20 percent according to IGS Energy (IGS Energy, 2000-2021). The cost of the panel increases with an increase in high solar panel efficiency [8]. The efficiency of the PV panel depends on temperature, solar irradiance, tilt angle, panel orientation, shading, several types of solar cells, age of panels, deuteriation of panels, dirt and dust deposit and configuration of series and parallel cells [9]. The increase in temperature of the panel increases the resistance of the semiconductor material leads to power loss and reduction in efficiency. The dust deposited over the surface of the panels block the sunlight and decreases the output power of the solar panel. A potential long-term degradation of panel components will be caused due to high humidity that can cause condensation. The performance of the solar panel is collectively influenced by all these factors and makes periodical maintenance to attain optimal efficiency. The key factor to improve solar efficiency is to capture maximum solar energy by changing the inclination of the panels. This maximizes the electrical power generation output of the solar PV panel [10].
1.2 Artificial technique to predict solar PV power
Machine learning (ML) approaches are also used in finding out the optimum tilt angle to get high performance of solar panel [5] the art of making the computers learn and act by giving data to it. The data that is familiar to the machine by its name is called labeled data. Labeled data is used to train the machine and to predict the results in the supervised learning algorithms [11]. By learning a mapping from inputs to outputs, these algorithms seek to make it feasible to forecast the results [12]. The work is done with a Common supervised learning algorithms like Linear Regression and Stepwise Linear Regression. It is used for predicting the continuous outcomes [13]. The study validates its model against existing regression models. Previous research on optimal tilt angles is referenced. Comparison with studies from various global locations is included. ML methods for optimization challenges are discussed.
The importance of tilt angle in solar energy systems is emphasized [14]. The paper reviews tilt angle adjustments for solar panel performance. Previous studies suggested 4-12 adjustments annually for optimization. Optimal intervals for tilt angle adjustments were not previously studied [15]. The paper reviews methods for computing tilt angles (TA). It discusses the importance of TA for photovoltaic (PV) efficiency. Various studies on optimal tilt angles in different regions are mentioned. The relationship between TA and latitude angle is highlighted. Previous methods show the significance of solar energy utilization [16]. The paper compares empirical models for estimating solar radiation. Two models overestimated tilt angles for high latitude locations. Previous models were developed using high latitude datasets. Theoretical models for low latitude tilt angles were established. Clean PV systems outperform soiled systems in energy production. Orientation and tilt angle significantly affect PV performance and energy output [17]. The paper references numerous studies on solar panel efficiency. Environmental factors significantly affect solar panel performance. Solar trackers improve solar panel efficiency by adjusting orientations. Previous research includes artificial intelligence in solar tracking [18]. Significant work on solar energy performance enhancement exists. Solar monitoring devices improve solar panel output. Sun ray monitoring device updates local parameters for efficiency. Manual adjustments are still required for some devices. Solar sensors enhance room light source output [19]. The study focuses on grid-tied photovoltaic systems. It evaluates monocrystalline and polycrystalline PV systems. Performance parameters include final yield, performance ratio, and capacity factor. Previous studies assessed PV performance in various global locations. Factors affecting performance include module quality and environmental conditions. Dust significantly reduces PV module efficiency. The research highlights the need for AI-based performance analysis [20]. Discusses solar photovoltaic panels and their applications. Reviews current studies and models on horizontal solar panels. Highlights the need for efficient land use in solar energy. Examines Air Force energy objectives and solar energy initiatives. Covers factors affecting solar panel performance, including temperature and humidity. Analyzes statistical modeling techniques for photovoltaic power output [21]. Solar photovoltaic production can be tested or predicted. Dust, humidity, and air velocity affect solar panel efficiency. Fine particles significantly reduce solar panel output. Higher tilt angles reduce dust accumulation. Self-cleaning coatings show similar performance to non-coated panels. Dust concentrations vary across different solar panel models. Dust mass correlates with decreased solar output power. Rainfall impacts solar panel cleaning efficiency. Dust accumulation reduces efficiency by 10% in dry conditions. Environmental conditions influence solar panel output power [22]. The paper reviews solar radiation prediction techniques from recent studies. It focuses on SVM models and hybrid SVM optimized models. Search optimization algorithms like GA and PSO are discussed. The review includes articles from the last five years. SVM with GA shows better performance than classical SVM models [23]. The paper reviews solar photovoltaic panel cleaning systems. It discusses factors affecting PV module performance. Various cleaning mechanisms and their evaluations are reviewed. ML implementation for cleaning systems is suggested. A decision-making framework for automated cleaning is proposed [24]. Global energy consumption is increasing, causing resource shortages. South Africa faces electricity load shedding since 2007 [25]. Rising fossil fuel prices drive renewable energy development. Solar energy installations grew from 67.4 to 627 gigawatts (2011-2019). Solar energy's global contribution increased from under 1% to 27%. Solar panel efficiency ranges from 15% to 40% [26]. Linear regression and Step wise linear regression methods assumes linear relations only whereas complex nonlinear [27] need to be analysis. The step-wise linear regression approach exhibits significant collectiveness despite its limited features [28]. Most studies use sophisticated deep learning techniques have not compared linear regression versus step-wise linear regression [29]. Absence of operational performance and real-world case studies for linear regression and step-wise linear regression-based calculations in solar energy output [30].
In this study, solar irradiance, open circuit voltage, short circuit current, humidity, temperature, current and voltage, for a particular load at different tilt angles (0°, 10°, 20°, 30°, to 90°) are measured on hourly basis on a day at university of Technology and Applied Sciences-Shinas campus by using an experimental setup as shown in Figure 1. Each hour, ten values of above-mentioned data are recorded for a period of one year. ML techniques have been implemented on the collected data, and the maximum power of the solar panel was predicted.
Figure 1. Experimental setup for data collection
The Experiment data is collected and then processed. The Input (X1, X2 .... Xn) and output variable (Y1) are identified. This paper uses ML and deep learning algorithms with regression learner model to train the data. For training, testing, validation, and prediction 70% ,15%, 15%, and 20% data is used respectively. During the training process nine models and twenty-seven algorithms were used. The validation of training models is done by analyzing RMSE, R2, MSE, MAE, MASE, prediction speed and training time. The best test models are selected by analyzing RMSE, R2, MSE, MAE, MASE values during testing. Prediction has been done by inputting the prediction data set and by y(Fit) = model. Prediction(T). Finally predicted values for different algorithms are compared with the true values being measured during the experimentation process.
The authors have used solar irradiance, open circuit voltage, short circuit current, humidity, temperature, voltage, and current at a load are measured from the experimental setup with different tilt angles (0°, 10°, 20°, 30°, to 90°) to train the model. The technique used to train, test, and predict the data was regression learner from ML. The Liner Regression and Stepwise Linear Regression algorithms are the most appropriate based on the low error values and high regression coefficient.
4.1 Liner regression algorithm
The linear regression algorithm accuracy was found by the RMSE, MAE, MSE, prediction speed, training time, and R coefficient values as shown in Table 1. after the training. Similarly, the linear regression model’s test accuracy is found by RMSE, MAE, MSE, and R2 values as shown in Table 2.
Table 1. Accuracy of training models
|
S.No. |
Training Models |
Results |
|
1 |
RMSE |
2.0225e-8 |
|
2 |
R2 |
1.00 |
|
3 |
MSE |
4.0904e-16 |
|
4 |
MAE |
1.3559e-9 |
|
4 |
Prediction speed |
1000 obs/sec |
|
5 |
Training time |
10.105 sec |
Table 2. Accuracy of test models
|
S.No. |
Test Models |
Results |
|
1 |
RMSE |
5.5607e-12 |
|
2 |
R2 |
1.00 |
|
3 |
MSE |
3.0922e-23 |
|
4 |
MAE |
8.2597e-13 |
Figure 2 shows the predicted data and actual data responses for linear regression algorithm. It clearly indicates that the predicted data response is linear and fits with the actual data responses. The prediction response of linear regression algorithm is also linear for the output variables data samples and solar panel power.
Figure 3 illustrates the data samples and solar panel power prediction responses for linear regression algorithm. It clearly shows that the prediction response is linear and fits with the actual solar panel power.
Figure 4 illustrates the ability to produce solar power of the solar farm that can be estimated using the residual plot diagram. Because of the great training and testing accuracy, the training and test data in this diagram have a normal distribution. Regression problems are evaluated using the R2 criteria as classification problems and was obtained as one for both training and test data.
Figure 5 shows that it is possible to estimate the solar panel's production power. We can see that the distribution of the real and projected data in this plot is similar because of the high training and testing accuracy. This graph makes it clear that the linear regression approach will produce precise forecasts with 0.7% of error.
Figure 2. Predicted response vs true response
Figure 3. Power output response predicted vs true
Figure 4. Residual plot diagram
Figure 5. Actual power vs predicted power 1
4.2 Step wise liner regression algorithm
At the end of training, the stepwise liner regression algorithm accuracy was found from the values of Root Means Square Error (RMSE), Mean Absolute Error (MAE), Mean Squared Error (MSE), prediction speed, training time, and regression coefficient R2 as shown in Table 3. Similarly, the stepwise liner regression algorithm test accuracy is found from the values of RMSE, MAE, MSE, and regression coefficient (R2) as shown in Table 4.
Table 3. Accuracy of training models
|
S.No. |
Training Models |
Results |
|
1 |
RMSE |
1.1345e-8 |
|
2 |
R2 |
1.00 |
|
3 |
MSE |
1.2871e-16 |
|
4 |
MAE |
7.5976e-10 |
|
5 |
Prediction speed |
1700obs/sec |
|
6 |
Training time |
91.449 sec |
Table 4. Accuracy of test models
|
S.no |
Test Model |
Results |
|
1 |
RMSE |
2.6623e-10 |
|
2 |
R2 |
1.00 |
|
3 |
MSE |
7.0877e-20 |
|
4 |
MAE |
3.847e-11 |
Figure 6 shows the predicted data and actual data responses for stepwise linear regression algorithm. It clearly shows that the predicted data response is linear and fits with the actual data responses.
Figure 7 illustrates the data samples and solar panel power prediction responses for stepwise linear regression algorithm. It clearly shows that the prediction response is linear and fits with the actual solar panel power.
Figure 8 illustrates the production capacity of the solar farm can be estimated using the residual plot diagram. Because of the great training and testing accuracy, we can see that the training and test data in this diagram have a normal distribution. Regression problems are evaluated using the same R2 criteria as classification problems and was obtained as one for both training and test data.
Figure 9 indicates that, it is possible to expect solar panel's production power. We can see the distribution of the real and projected data in this plot is similar due to high training and testing accuracy. This graph makes it clear that, the step wise linear regression approach will produce precise forecasts with 0.45% MAP error.
Figure 6. Predicted response vs true response
Figure 7. Power output response predicted vs true
Figure 8. Residual plot diagram
Figure 9. Actual power vs predicted power 2
4.3 Comparison between actual and predicted powers
Figure 10 shows that it is possible to estimate the solar panel's production power with the help of ML tools. We can see that the distribution of the real and projected data in this plot is similar because of the high training and testing accuracy with the help of linear and stepwise linear regression.
Figure 10. Linear regression prediction response
The main source of electricity for photovoltaic panels is sunshine. Weather, sun radiance, and season are some of the variables that impact solar panel production. To implement solar applications as per new era it is needed prediction of solar power for future is also important. By using ML techniques solar power predicting energy output and efficiency under varying environmental conditions. In this study linear regression and stepwise linear regression models are used to predict the solar power. Nevertheless, there are certain drawbacks to using a linear regression model, such as the incapacity to capture intricate nonlinear connections. As a result, forecast accuracy is dynamic. We can get around this issue by employing stepwise linear regression model.
A regression coefficient value of R² ≈ 1 as obtained after training the model indicates that there is a high correlation between expected and actual values. It is concluded that both Liner regression Stepwise linear regression algorithms are highly effective in fitting the data and predicting the sample data and Solar panel output power. The RMSE, MAE, and MSE values are exceptionally low indicate that the reliability and precision of both Liner regression Stepwise linear regression algorithms while predicting the solar panel output power. The Mean Absolute Percentage Error (MAPE) is 0.7% and 0.45% for linear regression algorithm and stepwise linear regression algorithm respectively. The response graphs of training and testing models indicate a linear relationship between the predicted and actual values for both Liner regression Stepwise linear regression algorithms. This confirms the consistency of both algorithms in the experimental data. After analyzing the results, both the linear regression and stepwise linear regression algorithms are effective to predict the solar panel output power by ML techniques. Since both algorithms are effective it is possible to get accurate and real time forecasting.
Prediction of the solar panel power output have the following practical implications in the real-world applications. Optimizing the energy production based on expected availability of sunlight. It helps the grid to minimize the dependency on non-renewable energy sources. It aids in enhancing the solar panel efficiency, by accurate prediction on the effective tilt angle and orientation of the solar panels. It is possible from the prediction to determine, when to perform the maintenance, reduce the maintenance cost and down time. By proper forecasting, the excess energy can be stored in batteries that can be used during low production period. The accurate predictions allow the solar energy be efficiently integrated with other energy systems results in improving the reliability of the power system. It assists in generating electrical power with cleaner sustainable environment that reduces the environmental impact on Fossil fuels. It supports the decision-making process of a consumer by providing expected energy production, cost savings, and energy independence. This study can facilitate integration of Advanced Machine Learning Models, Hybrid Modeling Approaches, Feature Engineering and Optimization, Scalability to Large-Scale Solar Farms, Integration with Renewable Energy Grids and Development of Open-Source Tools.
[1] Al-Rubaiai, I.H., Kazem, H.A. (2024) Harnessing Oman’s seawater resources to support the Green Hydrogen Revolution. Energy Oman. https://energyoman.net/wp-content/uploads/2024/04/Energy-Oman-12-edition.pdf.
[2] Charabi, Y., Rhouma, M.B.H., Gastli, A. (2010). GIS-based estimation of roof-PV capacity & energy production for the Seeb region in Oman. In 2010 IEEE International Energy Conference, Manama, Bahrain, pp. 41-44. https://doi.org/10.1109/ENERGYCON.2010.5771717
[3] Abdelaal, A.K., El-Fergany, A. (2023). Estimation of optimal tilt angles for photovoltaic panels in Egypt with experimental verifications. Scientific Reports, 13: 3268. https://doi.org/10.1038/s41598-023-30375-8
[4] Assouline, D., Mohajeri, N., Scartezzini, J.L. (2015). A machine learning methodology for estimating roof-top photovoltaic solar energy potential in Switzerland. In Proceedings of International Conference CISBAT 2015 Future Buildings and Districts Sustainability from Nano to Urban Scale, EPFL, Lausanne, pp. 555-560. https://doi.org/10.5075/epfl-cisbat2015-555-560
[5] Cheng, H.Y., Yu, C.C., Hsu, K.C., Chan, C.C., Tseng, M.H., Lin, C.L. (2019). Estimating solar irradiance on tilted surface with arbitrary orientations and tilt angles. Energies, 12(8): 1427. https://doi.org/10.3390/en12081427
[6] Khilar, R., Suba, G.M., Kumar, T.S., Samson Isaac, J., Shinde, S.K., Ramya, S., Prabhu, V., Erko, K.G. (2022). Improving the efficiency of photovoltaic panels using machine learning approach. International Journal of Photoenergy, 2022(1): 4921153. https://doi.org/10.1155/2022/4921153
[7] Nwokolo, S., Obiwulu, A., Amadi, S., Ogbulezie, J. (2023). Assessing the impact of soiling, tilt angle, and solar radiation on the performance of solar PV systems. Trends in Renewable Energy, 9(2): 120-136. https://doi.org/10.17737/tre.2023.9.2.00156
[8] Yar, A., Arshad, M.Y., Asghar, F., Amjad, W., Asghar, F., Hussain, M.I., Lee, G.H., Mahmood, F. (2022). Machine learning‐based relative performance analysis of monocrystalline and polycrystalline grid‐tied PV systems. International Journal of Photoenergy, 2022(1): 3186378. https://doi.org/10.1155/2022/3186378
[9] Vengatesh Ramamurthi, P., Rajan Samuel Nadar, E. (2022). IoT-based energy monitoring and controlling of an optimum inclination angle of the solar panels. IETE Journal of Research, 68(4): 3108-3118. https://doi.org/10.1080/03772063.2020.1754301
[10] Solyali, D., Mollaei, A. (2025). A simulation model based on experimental data to determine the optimal tilt angle for a fixed photovoltaic panel. Archives of Advanced Engineering Science, 3(1): 11-21. https://doi.org/10.47852/bonviewaaes3202907
[11] Djeldjeli, Y., Taouaf, L., Alqahtani, S., Mokaddem, A., Alshammari, B.M., Menni, Y., Kolsi, L. (2024). Enhancing solar power forecasting with machine learning using principal component analysis and diverse statistical indicators. Case Studies in Thermal Engineering, 61: 104924. https://doi.org/10.1016/j.csite.2024.104924
[12] MATLAB Help Center. (2024). Machine learning in MATLAB. https://www.mathworks.com/help/stats/machine-learning-in-matlab.html.
[13] Khadka, N., Bista, A., Adhikari, B., Shrestha, A., Bista, D., Adhikary, B. (2020). Current practices of solar photovoltaic panel cleaning system and future prospects of machine learning implementation. IEEE Access, 8: 135948-135962. https://doi.org/10.1109/ACCESS.2020.3011553
[14] Khan, P.W., Byun, Y.C., Lee, S.J. (2022). Optimal photovoltaic panel direction and tilt angle prediction using stacking ensemble learning. Frontiers in Energy Research, 10: 865413. https://doi.org/10.3389/fenrg.2022.865413
[15] Abou Akrouch, M., Chahine, K., Faraj, J., Hachem, F., Castelain, C., Khaled, M. (2023). Advancements in cooling techniques for enhanced efficiency of solar photovoltaic panels: A detailed comprehensive review and innovative classification. Energy and Built Environment. https://doi.org/10.1016/j.enbenv.2023.11.002
[16] Kim, Y., Byun, Y. (2022). Predicting solar power generation from direction and tilt using machine learning XGBoost regression. Journal of Physics: Conference Series, 2261(1): 012003. https://doi.org/10.1088/1742-6596/2261/1/012003
[17] Kshatri, S.S., Dhillon, J., Mishra, S., Tariq, R., et al. (2022). Reliability analysis of bifacial PV panel-based inverters considering the effect of geographical location. Energies, 15(1): 170. https://doi.org/10.3390/en15010170
[18] Kulkarni, S., Duraphe, K., Chandwani, L., Jaiswal, S., Kakade, S., Kulkarni, R. (2021). Optimizing solar panel tilt using machine learning techniques. In 2021 3rd Global Power, Energy and Communication Conference (GPECOM), Antalya, Turkey, pp. 190-195. https://doi.org/10.1109/GPECOM52585.2021.9587892
[19] Mamun, M.A.A., Islam, M.M., Hasanuzzaman, M., Selvaraj, J. (2022). Effect of tilt angle on the performance and electrical parameters of a PV module: Comparative indoor and outdoor experimental investigation. Energy and Built Environment, 3(3): 278-290. https://doi.org/10.1016/j.enbenv.2021.02.001
[20] Asadi, S.K., Sreeranganayakulu, J., Kshatri, S.S., Mohammad, K.S. (2024). Performance evaluation of PV configurations considering degradation rate and hot spots. Indonesian Journal of Electrical Engineering and Computer Science, 35(3): 1397-1403. https://doi.org/10.11591/ijeecs.v35.i3.pp1397-1403
[21] Pattanaik, S.S., Sahoo, A.K., Panda, R., Behera, S. (2024). Life cycle assessment and forecasting for 30kW solar power plant using machine learning algorithms. e-Prime-Advances in Electrical Engineering, Electronics and Energy, 7: 100476. https://doi.org/10.1016/j.prime.2024.100476
[22] Garg, R., Mittal, A., Syed, K., Asim, M., Chakravorty, A., Goyal, S. (2024). Linear Quadratic Regulator (LQR)-based load frequency control in power systems. In 2024 2nd World Conference on Communication & Computing (WCONF), Raipur, India, pp. 1-6. https://doi.org/10.1109/WCONF61366.2024.10692249
[23] Teyabeen, A.A., Mohamed, F. (2024). Estimation of the optimum tilt angle of solar PV panels to maximize incident solar radiation in Libya. Energies, 17(23): 5891. https://doi.org/10.3390/en17235891
[24] Yadav, A.K., Yadav, V., Kumar, A., Kumar, R., Lee, D., Singh, T. (2024). Novel feature selection based ANN for optimal solar panels tilt angles prediction in micro grid. Case Studies in Thermal Engineering, 61: 104853. https://doi.org/10.1016/j.csite.2024.104853
[25] Mohammad, K.S., Chekka, R.K. (2023). Comparative analysis on power quality improvement in autonomous micro grids using PSO, HHO and hybrid controller. International Journal of Power Electronics and Drive Systems (IJPEDS), 14(4): 2052-2063. https://doi.org/10.11591/ijpeds.v14.i4.pp2052-2063
[26] Liza, F.T., Das, M.C., Pandit, P.P., Farjana, A., Islam, A.M., Tabassum, F. (2023). Machine learning-based relative performance analysis for breast cancer prediction. In 2023 IEEE World AI IoT Congress (AIIoT), Seattle, WA, USA, pp. 0007-0012. https://doi.org/10.1109/AIIoT58121.2023.10174469
[27] Anyadiegwu, C.I., Okalla, C.E., Kerunwa, A., Igbo, S.C., Abah, J.A. (2024). Comparative analysis of linear regression and artificial neural networks for permeability prediction in reservoir characterization. Improved Oil and Gas Recovery, 8. https://doi.org/10.14800/IOGR.1312
[28] Sharma, N. (2023). Multiple linear regression: Beyond simple linear regression. Medium. https://medium.com/@nitin.data1997/multiple-linear-regression-beyond-simple-linear-regression-b533cabff376.
[29] Alvi, J., Arif, I., Nizam, K. (2024). Advancing financial resilience: A systematic review of default prediction models and future directions in credit risk management. Heliyon, 10(21): e39770. https://doi.org/10.1016/j.heliyon.2024.e39770
[30] Alazemi, T., Darwish, M., Radi, M. (2024). Renewable energy sources integration via machine learning modelling: A systematic literature review. Heliyon, 10(4): e26088. https://doi.org/10.1016/j.heliyon.2024.e26088