# A Machine Learning Approach to Low-Cost Photovoltaic Power Prediction Based on Publicly Available Weather Reports

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

_{2}emissions, which represent one of the main reasons for the greenhouse effect in the atmosphere and global warming. A plan to limit global warming is described in the Paris Agreement, which entered into force on 4 November 2016. The first point of this agreement defines that the increase in global average temperature should not exceed 2 °C in comparison to the pre-industrial level [1].

## 2. Data

#### 2.1. Photovoltaic Power Output

#### 2.2. Weather Data

^{2}) were taken from the year 2019.

#### 2.3. Additional Descriptive Feature

#### 2.3.1. PV Power under Clear-Sky Conditions

- Latitude, longitude, altitude, and time zone of PV system location;
- Some meteorological parameters, like air temperature and pressure (if these parameters are not available, pvlib uses default values: T = 12 °C, pressure = none);
- Time period for which the GHI is calculated.

^{2}). For this step, the maximum value of the PV power measurements ${P}_{PV,max}$ (W) was divided by the maximum value of the GHI under clear-sky conditions $GH{I}_{clearsky,max}$ (W/m

^{2}) (see Equation (1)).

#### 2.3.2. Maximum PV Power

#### 2.4. Data Exploration

#### 2.5. Correlation Analysis and Feature Selection

## 3. Methodology

#### 3.1. Machine Learning Algorithm

- LSTM is able to learn long-term dependencies that are typically found in time series. All used input datasets were time series (weather data and measurements of PV power).
- This structure of the ANN can remember relevant information for long periods of time.
- In the case of great time lags, the special structure of the LSTM prevents the error signals from increasing or vanishing.

#### 3.2. Description of Developed Predictive Model

- First layer with five input parameters;
- Two hidden LSTM layers with 64 and 32 neurons;
- Output dense layer;
- The total number of trainable parameters was 30,369.

#### 3.3. Content and Sizes of the Training and Test Sets

#### 3.4. Evaluation of Prediction Accuracy

_{0}is the installed capacity of the PV system.

- The season was taken as one day;
- $m$ in Equation (8) was set to 48, because the time resolution of the data was 30 min;
- ${\mathrm{P}}_{\mathrm{m}\mathrm{e}\mathrm{a}\mathrm{s},\mathrm{i}}$ in Equation (8) was the measured power of the PV system at time $i$;
- ${\mathrm{P}}_{\mathrm{m}\mathrm{e}\mathrm{a}\mathrm{s},\mathrm{i}-\mathrm{m}}$ in Equation (8) was the measured power of the PV system at the same time yesterday.

## 4. Results and Discussion

#### 4.1. Choice of the Additional Descriptive Feature

_{P}). Both training datasets contained 90 days of data. The architecture of the predictive model and the procedure of the predictive process also remained the same. The only difference was that the first input dataset contained maximum PV power and the second input dataset contained clear-sky PV power as the additional descriptive feature.

#### 4.2. Prediction with Publicly Available Weather Reports

#### 4.3. Prediction with Fee-Based Solar Irradiance Data

## 5. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Global Alliance for Buildings and Construction. Towards a Zero-Emission, Efficient, and Resilient Buildings and Construction Sector; Global Status Report 2017; Global Alliance for Buildings and Construction, International Energy Agency, UN Environment: Paris, France, 2017. [Google Scholar]
- Federal Ministry for the Environment, Nature Conservation, Building and Nuclear Safety (BMUB). Climate Action Plan 2050. Principles and Goals of the German Government’s Climate Policy; Federal Ministry for the Environment, Nature Conservation, Building and Nuclear Safety (BMUB): Berlin, Germany, 2016. [Google Scholar]
- National Renewable Energy Laboratory; National Center for Photovoltaics. Photovoltaics and Commercial Buildings―A Natural Match; National Renewable Energy Laboratory: Golden, CO, USA, 1998.
- National Renewable Energy Laboratory, Office of Energy Efficiency & Renewable Energy. Nationwide Analysis of U.S. Commercial Building Solar Photovoltaic (PV) Breakeven Conditions; National Renewable Energy Laboratory: Golden, CO, USA, 2015.
- Hanke, B.; Bottega, M.; Peters, D.; Maitanova, N.; Telle, J.-S.; Grottke, M.; von Maydell, K.; Agert, C. Fully Automated Photovoltaic System Modelling for Low Cost Energy Management Applications Based on Power Measurement Data. In Proceedings of the 35th European Photovoltaic Solar Energy Conference and Exhibition, Brussels, Belgium, 24–28 September 2018; pp. 1588–1593. [Google Scholar]
- Wang, S.; Sun, Y.; Zhou, Y.; Mahfoud, R.J.; Hou, D. A New Hybrid Short-Term Interval Forecasting of PV Output Power Based on EEMD-SE-RVM. Energies
**2019**, 13, 87. [Google Scholar] [CrossRef][Green Version] - Kwon, Y.; Kwasinski, A.; Kwasinski, A. Solar Irradiance Forecast Using Naïve Bayes Classifier Based on Publicly Available Weather Forecasting Variables. Energies
**2019**, 12, 1529. [Google Scholar] [CrossRef][Green Version] - Raza, M.Q.; Nadarajah, M.N.; Ekanayake, C. On recent advances in PV output power forecast. Sol. Energy
**2016**, 136, 125–144. [Google Scholar] [CrossRef] - Mosavi, A.; Salimi, M.; Faizollahzadeh Ardabili, S.; Rabczuk, T.; Shamshirband, S.; Varkonyi-Koczy, A.R. State of the Art of Machine Learning Models in Energy Systems, a Systematic Review. Energies
**2019**, 12, 1301. [Google Scholar] [CrossRef][Green Version] - Antonanzas, J.; Osorio, N.; Escobar, R.; Urraca, R.; Martinez-de-Pison, F.; Antonanzas-Torres, F. Review of photovoltaic power forecasting. Sol. Energy
**2016**, 136, 78–111. [Google Scholar] [CrossRef] - Das, U.K.; Tey, K.S.; Seyedmahmoudian, M.; Mekhilef, S.; Idris, M.Y.I.; Van Deventer, W.; Horan, B.; Stojcevski, A. Forecasting of photovoltaic power generation and model optimization: A review. Renew. Sustain. Energy Rev.
**2018**, 81, 912–928. [Google Scholar] [CrossRef] - Mohammed, A.; Aung, Z. Ensemble Learning Approach for Probabilistic Forecasting of Solar Power Generation. Energies
**2016**, 9, 1017. [Google Scholar] [CrossRef] - Das, U.K.; Tey, K.S.; Seyedmahmoudian, M.; Idris, M.Y.I.; Mekhilef, S.; Horan, B.; Stojcevski, A. SVR-Based Model to Forecast PV Power Generation under Different Weather Conditions. Energies
**2017**, 10, 876. [Google Scholar] [CrossRef] - Rosato, A.; Altilio, R.; Araneo, R.; Panella, M. Prediction in Photovoltaic Power by Neural Networks. Energies
**2017**, 10, 1003. [Google Scholar] [CrossRef][Green Version] - Khandakar, A.; Chowdhury, M.E.H.; Kazi, M.-K.; Benhmed, K.; Touati, F.; Al-Hitmi, M.; Gonzales, A.J.S.P. Machine Learning Based Photovoltaics (PV) Power Prediction Using Different Environmental Parameters of Qatar. Energies
**2019**, 12, 2782. [Google Scholar] [CrossRef][Green Version] - Kuzmakova, A.; Colas, G.; McKeehan, A. Short-term Memory Solar Energy Forecasting at University of Illinois; University of Illinois: Champaign, IL, USA, 2017. [Google Scholar]
- Gensler, A.; Henze, J.S.B.; Raabe, N. Deep Learning for Solar Power Forecasting—An Approach Using Autoencoder and LSTM Neural Networks. In Proceedings of the 2016 IEEE International Conference on Systems, Man, and Cybernetics (SMC 2016), Budapest, Hungary, 9–12 October 2016; pp. 2858–2865. [Google Scholar]
- Abdel-Nasser, M.; Mahmoud, K. Accurate photovoltaic power forecasting models using deep LSTM-RNN. Neural Comput. Appl.
**2017**, 31, 2727–2740. [Google Scholar] [CrossRef] - Kelleher, J.D.; Namee, B.M.; D’Arcy, A. Fundamentals of Machine Learning for Predictive Data Analytics: Algorithms, Worked Examples, and Case Studies; The MIT Press: Cambridge, MA, USA, 2015. [Google Scholar]
- Openweather Ltd. OpenWeatherMap. Available online: https://openweathermap.org (accessed on 7 January 2019).
- Kalisch, J.; Schmidt, T.; Heinemann, D.; Lorenz, E. Continuous Meteorological Observations in High-Resolution (1Hz) at University of Oldenburg; PANGAEA. Data Publisher for Earth & Environmental Science: Bremerhaven, Germany, 2015. [Google Scholar] [CrossRef]
- Holmgren, W.F.; Hansen, C.W.; Mikofski, M.A. pvlib python: A python package for modeling solar energy systems. J. Open Source Softw.
**2018**, 3, 884. [Google Scholar] [CrossRef][Green Version] - Reno, M.J.; Hansen, C.W.; Stein, J.S. Global Horizontal Irradiance Clear Sky Models: Implementation and Analysis; Sandia National Laboratories: Albuquerque, NM, USA, 2012. [Google Scholar]
- Flores, E. A pragmatic view of accuracy measurement in forecasting. Omega
**1986**, 14, 93–98. [Google Scholar] [CrossRef] - Hall, M.A. Correlation-based Feature Selection for Machine Learning; University of Waikato: Hamilton, New Zealand, 1999. [Google Scholar]
- Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput.
**1997**, 9, 1735–1780. [Google Scholar] [CrossRef] [PubMed] - Gers, F.A.; Schmidhuber, J.; Cummins, F. Learning to Forget: Continual Prediction with LSTM. In Proceedings of the 9th International Conference on Artificial Neural Networks: ICANN’99, Edinburgh, UK, 7–10 September 1999; pp. 850–855. [Google Scholar]
- Hua, Y.; Zhao, Z.; Li, R.; Chen, X.; Liu, Z.; Zhang, H. Deep Learning with Long Short-Term Memory for Time Series Prediction. IEEE Commun. Mag.
**2019**, 57, 114–119. [Google Scholar] [CrossRef][Green Version] - Chollet, F. Keras. 2015. Available online: https://keras.io (accessed on 22 October 2019).
- Hyndman, R.J.; Koehler, A.B. Another look at measures of forecast accuracy. Int. J. Forecast.
**2006**, 22, 679–688. [Google Scholar] [CrossRef][Green Version] - Hyndman, R.; Athanasopoulos, G. Forecasting: Principles and Practice, 2nd ed.; OTexts: Melbourne, Australia, 2018; Available online: https://www.otexts.com/fpp2 (accessed on 4 November 2019).
- Zinsser, B. Jahresenergieerträge unterschiedlicher Photovoltaik-Technologien bei verschiedenen klimatischen Bedingungen. Ph.D. Thesis, University Stuttgart, Stuttgart, Germany, 2010. [Google Scholar]

**Figure 1.**PV power output under clear-sky conditions on (

**a**) June 1st and (

**b**) December 1st 2017 estimated for the PV system in Oldenburg with an installed capacity of 1.14 kW

_{P}.

**Figure 2.**Correlation values between descriptive, additional, and target features. Values close to −1 mean a strong negative linear correlation, values close to 1 mean a strong positive linear correlation, and values around 0 mean no linear correlation [19].

**Figure 3.**Monthly correlation values among measured PV power, selected meteorological parameters, and additional features.

**Figure 4.**Internal structure of a single long short-term memory (LSTM) block (following the description of Hua et al. [28]).

**Figure 7.**Distribution of daily MAE values of PV power prediction after training the model without any additional feature and with maximum PV power or clear-sky PV power as additional features (training set 90 days; test set 8 August 2017–31 August 2017).

**Figure 8.**Daily values of MAE, RMSE, MAPE, and mean absolute scaled error (MASE) of PV power prediction for warm and cold seasons, which were made after training with four sizes of the training set containing publicly available weather reports.

**Figure 10.**MASE of PV power predictions with publicly available data and fee-based data. The prediction was made for the Munich PV system (installed capacity of 99.9 kW

_{P}).

**Figure 11.**Normalized distribution of the energy forecast errors of predictions with publicly available weather reports (training set with 90 days) and fee-based data (training set with 14 days). The prediction was made for the Munich PV system (installed capacity of 99.9 kW

_{P}).

**Figure 12.**Measured PV power of the Munich PV system in comparison to the PV power predictions made by the model with publicly available weather reports (training set with 90 days) and fee-based solar irradiance data (training set with 14 days) on 20 and 29 June 2019.

Location | Oldenburg | Munich |
---|---|---|

Installation year | 2010 | 2018 |

Total capacity | 1.14 kW_{P} | 99.9 kW_{P} |

Orientation | 237° | 177.5° |

Inclination | 7° | 10° |

Solar cell type | a-Si | mono-Si |

Nominal cell efficiency at standard test conditions | 6.6% | 17.9% |

Step 1 | |

Collection of PV power measurements of the last five days and plotting them in an overlaid manner. The power values of the PV system were recorded and presented in W. | |

Step 2 | |

Finding a maximum of the PV power for each time point. The maximum values are marked bold in the picture. | |

Step 3 | |

Leaving only the maximum values for each time point and deleting other values. These maximum PV power values had the same unit as PV power measurements (W). |

**Table 3.**Statistical metrics of OpenWeatherMap (OWM) forecast: MAE—mean absolute error; RMSE—root-mean-square error; sMAPE—symmetric mean absolute percentage error.

Investigated Meteorological Parameters from OWM | MAE | RMSE | sMAPE (%) |
---|---|---|---|

Temperature | 0.023 | 0.031 | 2.61 |

Pressure | 0.017 | 0.022 | 1.56 |

Humidity | 0.219 | 0.263 | 15.43 |

Cloudiness | 0.236 | 0.339 | 33.79 |

Wind speed | 0.079 | 0.100 | 20.11 |

Precipitation (rain) | 0.415 | 0.644 | 41.48 |

Precipitation (snow) | 0.023 | 0.150 | 2.31 |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Maitanova, N.; Telle, J.-S.; Hanke, B.; Grottke, M.; Schmidt, T.; Maydell, K.v.; Agert, C. A Machine Learning Approach to Low-Cost Photovoltaic Power Prediction Based on Publicly Available Weather Reports. *Energies* **2020**, *13*, 735.
https://doi.org/10.3390/en13030735

**AMA Style**

Maitanova N, Telle J-S, Hanke B, Grottke M, Schmidt T, Maydell Kv, Agert C. A Machine Learning Approach to Low-Cost Photovoltaic Power Prediction Based on Publicly Available Weather Reports. *Energies*. 2020; 13(3):735.
https://doi.org/10.3390/en13030735

**Chicago/Turabian Style**

Maitanova, Nailya, Jan-Simon Telle, Benedikt Hanke, Matthias Grottke, Thomas Schmidt, Karsten von Maydell, and Carsten Agert. 2020. "A Machine Learning Approach to Low-Cost Photovoltaic Power Prediction Based on Publicly Available Weather Reports" *Energies* 13, no. 3: 735.
https://doi.org/10.3390/en13030735