METHODS article

Front. Energy Res., 08 February 2024

Sec. Process and Energy Systems Engineering

Volume 11 - 2023 | https://doi.org/10.3389/fenrg.2023.1273805

A runoff-based hydroelectricity prediction method based on meteorological similar days and XGBoost model

  • 1. Yunnan Power Dispatching and Control Center, Yunnan Power Grid Co, Ltd., Kunming, China

  • 2. Beijing Tsintergy Technology Co, Ltd., Beijing, China

Abstract

This paper proposes a runoff-based hydroelectricity prediction method based on meteorological similar days and XGBoost model. Accurately predicting the hydroelectricity supply and demand is critical for conserving resources, ensuring power supply, and mitigating the impact of natural disasters. To achieve this, historical meteorological and runoff data are analyzed to select meteorological data that are similar to the current data, forming a meteorological similar day dataset. The XGBoost model is then trained and used to predict the meteorological similar day dataset and obtain hydroelectricity prediction results. To evaluate the proposed method, the hydroelectricity cluster in Yunnan, China, is used as sample data. The results show that the method exhibits high prediction accuracy and stability, providing an effective approach to hydroelectricity prediction. This study demonstrates the potential of using meteorological similar days and the XGBoost model for hydroelectricity prediction and highlights the importance of accurate hydroelectricity prediction for water resource management and electricity production.

1 Introduction

In recent years, with the rapid development of distributed small hydropower, its position in the field of clean energy has become increasingly important (). However, the power transmission distance in distributed small hydropower-rich areas is far, and the channel resources of the main power grid are limited. Furthermore, large and small hydropower stations occupy the channel resources, which has an impact on the main power grid. The problem of small interference stability is prominent, and it is difficult for the power dispatching department to accurately grasp the power generation capacity of small hydropower stations, resulting in the frequent occurrence of large-scale power generation and water abandonment of small hydropower stations, which seriously affects the utilization efficiency of clean energy and the safe and stable operation of the power grid (; ). Therefore, it has become an urgent problem to carry out the distributed small hydropower generation capacity prediction and provide reference for the power dispatching department to carry out the coordinated dispatch of multiple power sources.

In recent years, the field of hydropower has become the focus of many experts and scholars in the new energy sustainable development industry (). The traditional runoff hydropower forecasting method is mainly based on the trend extrapolation method, which has fast calculation speed and is suitable for forecasting with small load fluctuations (). However, the modeling process of this method is relatively complex and requires high stability of the historical data trend, which has certain limitations.

predicted the potential of small hydropower in the future by building a neural network model using climate change scenarios and artificial simulations. The prediction results are generally optimistic, but they cannot directly guide the power dispatching department to carry out the coordinated dispatch of multiple power sources, and they need to be combined with hydropower output prediction. comprehensively analyzed the advantages of using the XGBoost algorithm in prediction from the aspects of samples, characteristics, index performance, and model robustness. verified the effective application of different machine learning algorithms in hydropower forecasting by modeling three different scenarios in quarterly, monthly, and daily dimensions with different machine learning methods. With the continuous development of artificial intelligence technology, application of some machine learning methods, such as XGBoost algorithm, is gradually becoming feasible for runoff hydropower prediction (; ). These methods use the historical data as training samples, utilize the intelligent processing and self-learning mode of the algorithm, learn the mapping relationship between the historical data and the influencing factors, and apply the algorithm to predict the future load data after strengthening learning and improving the accuracy (; ; ). The XGBoost method shows the nonlinear mapping ability and strong self-adaptation ability and is expected to become an effective means to solve the problem of distributed small hydropower generation capacity prediction. introduced a deep learning method based on long short-term memory (LSTM) to predict the power generation of a run-of-the-river hydroelectric power plant 1 day in advance. In addition, in order to compare the prediction accuracy, the adaptive neural fuzzy inference system (ANFIS) and fuzzy C-means (FCM), ANIS and subtractive clustering (SC), and ANFIS grid partitioning (GP) methods were adopted, which shows that the LSTM neural network provides higher accuracy results in short-term energy production forecasting. combined the gray wolf method with ANFIS to predict hydroelectric power.

1.1 Research highlights

Forecasting the generation capacity of distributed small hydropower is an effective means to solve the problem of frequent large-scale water abandonment due to its long transmission distance, limited channel resources, unknown generation capacity, and other factors.

The XGBoost algorithm applied to runoff hydropower prediction has the ability of nonlinear mapping and strong self-adaptation, which can effectively improve the prediction accuracy and overall accuracy.

The artificial intelligence forecasting method takes historical data as training samples, and its intelligent processing and self-learning mode can learn the mapping relationship between historical data and the influencing factors and apply it to forecast future load data, which is an effective means to solve the problem of distributed small hydropower generation capacity forecasting.

2 Hydropower forecasting method

2.1 Principle of the XGBoost algorithm

The main problems of traditional runoff hydropower forecasting methods are as follows:

Complicated modeling process: Traditional runoff-based hydropower forecasting methods often involve complex modeling processes, which require specialized knowledge and skills, increasing the difficulty and cost of prediction.

High requirements for the stability of historical data trends: The effectiveness of these methods depends heavily on the stability of historical data. If the historical data trends change significantly, the accuracy of predictions based on these data may be affected.

Suitability for predictions with fewer load fluctuations: Due to the computational process and results of traditional methods being limited by the consistency and stability of historical data, they may be more suitable for predictions with fewer load fluctuations. For situations with greater load fluctuations, the accuracy of predictions may be reduced.

Limited adaptability to future changes in hydropower output: Traditional runoff-based hydropower forecasting methods are mainly based on extrapolating historical data, which may have limited the adaptability to future changes in hydropower output. If there are significant changes in hydropower output in the future, these methods may need to be adjusted or re-modeled.

Lack of handling of uncertainties: Traditional methods usually assume that the future hydropower output is deterministic, but in reality, the future hydropower output may be affected by many uncertain factors, such as climate change and fluctuations in the energy demand. Traditional methods lack effective handling of these uncertainties.

For the prediction of many quantities with uncertain characteristics, i.e., random variables, people often use the method of probability and statistic in engineering practice. The probability and statistic method requires finding statistical laws from a large number of data samples, and this statistical law must be easy to be processed by mathematical methods (

). Different from probability and statistics, the gradient boosting decision tree (GBDT) is a type of machine learning algorithm (

); its good performance in the prediction and classification of problems has been widely observed by industry researchers (

). The algorithm is composed of multiple decision trees and uses the negative gradient value of the loss function in the current model as the approximate value of the residual in the lifting tree for the regression fit of the decision tree (

). The general steps of the GBDT algorithm are as follows:

  • 1) Input training samples and set relevant parameters. The number of iterations is , is the function space composed of all trees, and is the single decision tree model; the initial value is , and the expression of the GBDT algorithm is as follows:

where

is the eigenvector of the

i

-th sample;

is the number of weak regression trees;

is the output value of the

k

-th weak regression tree; and

is the final predicted value of the

i

th sample.

  • 2) Define the objective function of the GBDT algorithm as

where is the complexity of the decision tree; is the total number of samples; is the loss function; and is the true value of the i-th sample.

The complexity is defined by the regular term:

where

is the number of nodes of the leaf;

is the vector value corresponding to the leaf node;

is the minimum loss reduction required for leaf node splitting of the tree; and

is the penalty term coefficient.

  • 3) According to the addition structure of the GBDT algorithm, we obtain

where is the sum of the outputs of the first trees of the i-th sample; is the sum of the outputs of the first trees of the (t-1)-th sample; and is the output value of the tth tree of the ith sample.

Substituting Eq. 4 into the objective function and carrying out the Taylor expansion, we obtain

where and and are the first and second derivatives of the loss function, respectively.

Let the first derivative of be 0. Then the optimal value of leaf node can be obtained as follows:

At this time, the objective function value is

  • 4) Generate a new decision tree through the greedy strategy to minimize the value of the objective function (), and obtain the optimal predictive value corresponding to the leaf node. Add the newly generated decision tree to the model to obtain

  • 5) Continue to iterate until the end of iterations, and output the GBDT algorithm composed of decision trees.

The GBDT algorithm has many effective implementations, such as the XGBoost algorithm and LightGBM algorithm, which are integrated learning algorithms of GBDT (; ).

XGBoost is an improved algorithm based on GBDT that uses multithreading parallelism to improve the accuracy and is suitable for classification and regression problems (Chen et al., 2016). The basic principle of XGBoost is the same as that of GBDT. The difference is that GBDT uses the first derivative of the loss function, while XGBoost uses the first and second derivatives to perform the second-order Taylor expansion of the loss function.

Experimentally, XGBoost is relatively faster than many other integrated classifiers, such as AdaBoost. The impact of the XGBoost algorithm has been widely recognized in many machine learning and data mining challenges, and it has become a more commonly used and popular tool among Kaggle’s competitors and industry data scientists. In addition to using different boosting algorithms, MART and XGBoost also provide different regularization parameters. In particular, XGBoost can provide additional parameters that are not available in GBDT. In addition, it provides the penalty for a single tree in the additive tree model. These parameters will affect the tree structure and the weighting of the leaves to reduce variance in each tree. In addition, XGBoost provides an additional randomization parameter that can be used to disassociate individual trees, thereby reducing the overall variance of the additive tree model ().

The loss function of the XGBoost algorithm is

where is the true value corresponding to the current sample ; is the predicted value of sample ; is the loss function; is the mth classification tree model; is the regularization term, which reflects the complexity of the algorithm; and is the model parameter to be solved.

The Taylor expansion is used to approximate function . Substituting Eq. 10 into Eq. 11, we obtain

where and are the first and second derivatives of on the loss function, respectively.

The regularization term in the objective function is

where is the minimum loss reduction required for further splitting at the leaf node of the tree, representing the complexity of each leaf, and is the value of the leaf node.

2.2 Runoff hydropower forecasting method based on XGBoost

The runoff hydropower prediction based on XGBoost is mainly divided into five steps: data collection, preprocessing, characteristic engineering, model training, and model validation (). We collect historical hydropower generation data, runoff data, and meteorological data related to hydropower generation. Among them, runoff data refer to the flow data of the river, which can be obtained through hydrological stations. After screening, de-duplication, and checking the collected data, the duplicate, invalid, and abnormal data are removed. Second, we process the missing data and filled the missing data using the interpolation method. Then, we use the method based on an isolated forest to detect and process the outliers of the data. In runoff hydropower prediction, feature engineering is a very important step. It can process the data reasonably and improve the prediction performance of the model. In this paper, we use a variety of feature engineering methods, including lag characteristics, time characteristics, and statistical characteristics. Table 1 lists the specific functions:

TABLE 1

Feature typeGenerated featureEffect
Hysteresis characteristicsHydropower output lag T-2Historical data reflect output characteristics
Water flow lag T-2Time lag effect of flow and output
Meteorological characteristicsRainfallRainfall directly affects runoff hydropower output
TemperatureTemperature affects rainwater evaporation
Time characteristicsYearReflects seasonal variation
MonthReflects seasonal variation
DayReflects seasonal variation
Statistical characteristicsAverage rate of flowReflects the correlation between hydropower generation and runoff
Variance rate of flowReflects the correlation between hydropower generation and runoff
Maximum rate of flowReflects the correlation between hydropower generation and runoff
Minimum rate of flowReflects the correlation between hydropower generation and runoff

Summary of characteristics.

Considering that meteorological data, which include multiple factors such as precipitation and temperature, have a great impact on runoff hydropower prediction, this paper proposes an XGBoost runoff hydropower prediction method based on “meteorological similar days.” Before model training, the meteorological data of the day to be predicted are first composed into a feature vector, and the similarity is then calculated by the feature vector composed of the feature vector of the forecast day and the historical meteorological data. This paper uses the reciprocal of Manhattan distance to measure the similarity between the two. The specific form is as follows:

where N represents the length of the meteorological vector, represents the ith element of the meteorological vector of the day to be predicted, and represents the ith element of the historical meteorological vector of a day. According to the above similarity, the XGBoost algorithm model is weighted by the loss function to increase the impact of similar samples on the forecast date. Finally, the model is verified based on this scheme.

3 Example analysis

We select the output data of the hydropower cluster in Yunnan area, which contains multistage runoff hydropower stations, as the sample data to evaluate the proposed method.

Hydropower prediction is a complex task. The industry usually uses capacity accuracy instead of RMSPE accuracy for the assessment of new energy. The formula is as follows:

where N is the number of output points collected in a day, taken as N = 96, and is the actual output value at the i-th time point in a day. is the predicted output value at the i-th time point in a day, and Cap is the capacity of the station.

The gray theory model (GM) is considered a classic model in the field of hydropower prediction, which mainly solves the problems of lack of data and uncertainty. Therefore, the prediction experimental group in this paper adopts the similar-day weighted XGBoost, while the control experimental group selects the original XGBoost and GM, normalizes the historical data to the interval of [−1,1], and takes 80% of the data as the training data and the remaining 20% as the test data. The prediction results are shown in Table 2.

TABLE 2

Dry/wet seasonDateSimilar-day weighted XGBoost/%Original XGBoost/%GM/%
Dry seasonDecember 8100.0097.1698.17
December 9100.0098.1598.53
December 10100.0099.4499.42
December 11100.0096.9899.71
December 1291.5088.8489.33
December 13100.0099.5499.41
December 1485.6060.5070.56
Average accuracy in the dry season96.7391.5193.60
Wet seasonJuly 296.1893.2492.51
July 395.4991.6389.75
July 497.5093.8491.23
July 596.0990.5288.41
July 697.8593.5690.24
July 799.7296.6393.38
Average accuracy in the wet season97.1493.2490.92

Comparison of prediction accuracy.

It can be seen from the above table that considering the same factors, the prediction accuracy of GM in the dry season is higher than that of the original XGBoost algorithm after sample screening according to our proposed similarity measure and allocating weights to the sample. The prediction accuracy of GM in the dry season is higher than that of the original XGBoost algorithm, but it is not ideal in the wet season. The effectiveness of the sample weight selection method based on similar days is demonstrated using the control experimental group. In addition, we found that the accuracy of the algorithm for winter data prediction is higher than that in the summer. This is because the summer weather changes violently, the unit output level fluctuates greatly, and the weather has an unbalanced effect. Therefore, it can be seen that the selection of meteorological data has a great impact on the prediction accuracy of small hydropower output.

An overall comparison shows that the similar-day weighted XGBoost has the highest prediction accuracy compared to original XGBoost and GM in both wet and dry periods.

The prediction results using the similar-day weighted XGBoost algorithm are shown in Figure 1. It can be seen that the hydropower cluster has higher output and stable cycle in the wet season, and the prediction accuracy of this algorithm is higher.

FIGURE 1

Figures 2, 3 show that the prediction accuracy of original XGBoost is higher than that of GM in the wet season. Through the comparison of Figures 13, it can be seen that similar-day weighted XGBoost has the best prediction effect in the wet season.

FIGURE 2

FIGURE 3

4 Summary

In this paper, a novel hydropower forecasting method combining meteorological similar days and XGBoost model is proposed. By analyzing the historical meteorological and runoff data, this paper selected the meteorological similar days with meteorological conditions similar to the current data, which provided a valuable reference for the prediction of hydropower output. The XGBoost model not only shows its effectiveness in learning meteorological similar day datasets but also produces accurate and stable hydropower prediction results. The results show that the combination of meteorological similar days and XGBoost model is a promising method to improve the accuracy of hydropower prediction. The high prediction accuracy and stability of this method are particularly beneficial to water resource management and power production, which is conducive to better planning and utilization of hydropower resources, while ensuring a reliable power supply.

The application of this method in the Yunnan hydropower cluster in China has successfully demonstrated its practicability and the potential for promotion in other regions and power systems. However, it is worth noting that the universality of this method in different geographical locations and different climatic conditions needs further research and verification. The method proposed in this paper has made a valuable contribution to the field of hydropower prediction, and its effectiveness in improving the accuracy and stability of prediction highlights its importance in solving the challenges encountered in water resource and energy management. With continuous attention to water resources and energy, we believe that this method will help strengthen the management of sustainable water resources and energy, reduce the impact of natural disasters, and promote the development of green and sustainable energy in the future.

Statements

Data availability statement

The raw data supporting the conclusion of this article will be made available by the authors without undue reservation.

Author contributions

YW: writing–review and editing. YX: writing–review and editing. FX: writing–original draft. XZ: conceptualization and writing–review and editing. SL: writing–review and editing.

Funding

The author(s) declare that no financial support was received for the research, authorship, and/or publication of this article.

Conflict of interest

Authors YW, YX, XZ, and SL were employed by Yunnan Power Grid Co., Ltd. Author FX was employed by Beijing Tsintergy Technology Co., Ltd.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors, and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

References

Summary

Keywords

hydroelectricity prediction, meteorological similar days, XGBoost model, runoff-based hydroelectricity, distributed

Citation

Wu Y, Xie Y, Xu F, Zhu X and Liu S (2024) A runoff-based hydroelectricity prediction method based on meteorological similar days and XGBoost model. Front. Energy Res. 11:1273805. doi: 10.3389/fenrg.2023.1273805

Received

07 August 2023

Accepted

12 December 2023

Published

08 February 2024

Volume

11 - 2023

Edited by

Chengguo Su, Zhengzhou University, China

Reviewed by

Sheng Xiang, Changsha University of Science and Technology, China

Mojtaba Nedaei, University of Padua, Italy

Updates

Copyright

*Correspondence: Fengjiao Xu, ; Shuangquan Liu,

Disclaimer

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.

Outline

Figures

Cite article

Copy to clipboard


Export citation file


Share article

Article metrics