Photovoltaic typical scene generation method based on improved fuzzy clustering
By using the Marshall distance and division entropy index to optimize the cluster number in the generation of typical photovoltaic scenes, and iteratively selecting the initial cluster center in combination with the K-mean clustering method, the cluster number selection and initial center selection time in the existing technology are solved. The problem has improved the accuracy of photovoltaic output prediction and the power system regulation capabilities.
Patent Information
- Application Number
- CN202411417453.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-07
AI Technical Summary
The existing photovoltaic typical scene generation method fails to fully consider the multidimensional influence of the distance between meteorological data samples. The cluster number needs to be selected artificially and the initial cluster center is selected for a long time, resulting in low prediction accuracy and efficiency.
The distance between meteorological data vector samples is calculated by using the Mahayana distance, the division entropy index is used to find the optimal cluster number, and the initial cluster center is iteratively selected through the K-mean clustering method to improve the fuzzy clustering method to generate typical photovoltaic scenes.
The clustering accuracy and efficiency are improved and human error is reduced. The generated typical scenarios can be used to improve the accuracy of photovoltaic output prediction and the power system regulation capabilities.
Smart Images

Figure CN119272082A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic power generation, and in particular to a method for generating typical photovoltaic scenes based on improved fuzzy clustering. Background Art
[0002] In response to the goals of carbon peak and carbon neutrality, we actively adjust the energy structure and vigorously promote the development of renewable energy. Photovoltaic and other renewable energy power generation are integrated into the power system on a large scale. However, since photovoltaic output often exhibits randomness and intermittency, accurate prediction of photovoltaic output is crucial for the stable operation and regulation of the power system. Photovoltaic typical scenario generation is an effective means to improve the accuracy of photovoltaic output prediction.
[0003] The current research on the generation of typical photovoltaic scenarios mainly focuses on clustering meteorological features to generate typical scenarios to adapt to the impact of weather changes on photovoltaics. For example, the historical meteorological data of photovoltaic power stations can be quickly clustered using the K-means algorithm to establish similar output scenarios; or, the Fuzzy C-means (FCM) clustering algorithm can be used to obtain more accurate data set clusters under similar scenarios to analyze the impact characteristics of different scenarios on photovoltaics; or, the K-Medoids algorithm can be used to cluster weather data and output sequences to match typical photovoltaic scenarios in the future period.
[0004] However, the above clustering methods usually use Euclidean distance to measure the similarity between samples, and fail to fully consider the impact of different meteorological factors on the distance between meteorological data samples; in addition, the number of clusters in the clustering process needs to be selected manually, which introduces operational errors; and, although fuzzy clustering has a high clustering accuracy in the clustering process, it takes a long time to select the initial cluster center. Summary of the invention
[0005] According to the technical problems raised above, a method for generating typical photovoltaic scenes based on improved fuzzy clustering is provided. The present invention mainly calculates the distance between meteorological data vector samples based on Mahalanobis distance; selects the partition entropy index as the criterion function, performs K-means clustering with different cluster numbers, and selects the optimal cluster number; based on the optimal cluster number and K-means clustering method, the initial cluster center is selected by clustering iteration; and the typical photovoltaic scenes are generated by clustering iteration using the fuzzy clustering method.
[0006] The technical means adopted by the present invention are as follows:
[0007] A photovoltaic typical scene generation method based on improved fuzzy clustering, comprising:
[0008] S1. Obtain historical data of the photovoltaic power station and perform preprocessing to obtain a historical data set;
[0009] S2, selecting direct irradiance, diffuse irradiance and temperature data as clustering objects, and constructing a meteorological data vector set;
[0010] S3. Calculate the distance between data vector samples based on Mahalanobis distance;
[0011] S4. Select the partition entropy index as the criterion function, perform K-means clustering with different cluster numbers, calculate the partition entropy index of the clustering results under each cluster number, and find the optimal cluster number generated by the typical scenario;
[0012] S5. Selecting initial cluster centers based on the optimal number of clusters and K-means clustering method;
[0013] S6. The initial cluster centers are iterated by the fuzzy clustering method to generate typical photovoltaic scenarios.
[0014] Furthermore, in step S3, the calculation formula for calculating the distance between data vector samples is as follows:
[0015]
[0016] Among them, x a 、x b (a≠b) is the meteorological data, and M is the covariance matrix of x.
[0017] Furthermore, in step S4, the calculation formula for calculating the partition entropy index of the clustering results under each cluster number is as follows:
[0018]
[0019] Among them, PE represents the partition entropy index, N B is the number of meteorological data vectors, is the degree of membership of meteorological data j to the i-th cluster center when the number of clusters is k.
[0020] Furthermore, step S4, at the tth iteration, specifically includes:
[0021] S41. Initialize clustering parameters: the number of clusters is k, and the maximum number of clusters k is given max , The number of iterations is 0, the cluster center set is an empty set, and the number of elements in the cluster center set is 0;
[0022] S42, selecting any element from the meteorological data vector set, adding the selected element to the cluster center set, increasing the number of elements in the cluster center set by 1, and removing the selected element from the meteorological data vector set;
[0023] S43, traversing the elements of the meteorological data vector set, calculating the Mahalanobis distance between each element and the selected element, and obtaining a first Mahalanobis distance group;
[0024] S44, selecting the maximum value in the first Mahalanobis distance group, removing the element corresponding to the maximum value from the meteorological data vector set and adding it to the cluster center set, and the number of elements in the cluster center set is increased by 1;
[0025] S45, judging whether the number of elements in the cluster center set is less than the number of cluster centers, if so, returning to step S43; if so, executing step S46;
[0026] S46, calculating the Mahalanobis distance between the elements of the cluster center set and the elements of the meteorological data vector set to obtain a second Mahalanobis distance group, and summing the second Mahalanobis distance group to obtain the t-th iteration Mahalanobis distance value;
[0027] S47, judging whether the absolute value of the difference between the Mahalanobis distance value of the t-th iteration and the Mahalanobis distance value of the t-1-th iteration is less than or equal to a threshold value, if it is greater than the threshold value, entering the t+1-th iteration; if it is less than or equal to the threshold value, the iteration ends, and the cluster center set and the corresponding output data vector set are output as the initial cluster center of the cluster number;
[0028] S48. Calculate the partition entropy index of the clustering results under each clustering number according to the above clustering results;
[0029] S49. Calculate the curvature for different values of the number of clusters. When the curvature is the largest, the corresponding number of clusters is the optimal number of clusters:
[0030] S410. Based on the above optimal number of clusters, return to step S41 to calculate the clustering result under the optimal number of clusters.
[0031] Furthermore, step S5, at the tth iteration, specifically includes:
[0032] S51: Initialize clustering parameters: the number of cluster centers is k best , the number of iterations is 0, and the fuzzy weighting coefficient m = 2;
[0033] S52: According to the above initial cluster center, the membership of the cluster center element to the cluster center is calculated to obtain a membership matrix;
[0034] S53: Update cluster center;
[0035] S54: Determine whether the absolute value of the difference between the Mahalanobis distance value of the t-th iteration and the Mahalanobis distance value of the t-1-th iteration is less than or equal to a threshold value. If it is greater than the threshold value, enter the t+1-th iteration; if it is less than or equal to the threshold value, the iteration ends, and the cluster center set and the meteorological data vector set are output, and the output result is used as a typical photovoltaic scene.
[0036] Furthermore, in step S1, the acquired historical data of the photovoltaic power station is preprocessed, specifically including:
[0037] Find abnormal data in the data, eliminate biased data, and complete missing data.
[0038] Compared with the prior art, the present invention has the following advantages:
[0039] 1. The present invention provides a photovoltaic typical scene generation method based on improved fuzzy clustering, which selects direct irradiance, scattered irradiance, and temperature data from multidimensional historical data as clustering objects, and proposes an improved fuzzy clustering method to generate photovoltaic typical scenes.
[0040] 2. The present invention provides a photovoltaic typical scene generation method based on improved fuzzy clustering, which calculates the distance between meteorological data samples based on the Mahalanobis distance, thereby reducing the influence of different physical quantities on the distance between calculated samples.
[0041] 3. The present invention provides a photovoltaic typical scene generation method based on improved fuzzy clustering, which selects the partition entropy index as the criterion function, performs K-means clustering with different cluster numbers, finds the optimal cluster number, and avoids subjective errors in the clustering process.
[0042] 4. The present invention provides a photovoltaic typical scene generation method based on improved fuzzy clustering, which iteratively generates initial cluster centers based on the optimal number of clusters and K-means clustering, thereby reducing the time for selecting the initial cluster centers by the fuzzy clustering method.
[0043] 5. The present invention provides a method for generating typical photovoltaic scenarios based on improved fuzzy clustering. The initial cluster centers are iteratively clustered according to the fuzzy clustering method to generate typical photovoltaic scenarios. The obtained typical scenario results can provide a reference for power system regulation, improve the level of renewable energy consumption, and thus increase the dispatching capacity of the power system.
[0044] Based on the above reasons, the present invention can be widely promoted in the fields of photovoltaic power generation and the like. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0046] Figure 1 The figure is a flow chart of the method of the present invention.
[0047] Figure 2 A typical scenario generation result provided by an embodiment of the present invention.
[0048] Figure 3The LSTM prediction model provided in the embodiment of the present invention predicts the output and measured output of a photovoltaic power station in a typical scenario.
[0049] Figure 4 The prediction error between the method of the present invention and the LSTM model without data processing provided in the embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0051] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0052] like Figure 1 As shown, the present invention provides a photovoltaic typical scene generation method based on improved fuzzy clustering, comprising:
[0053] S1. Obtain historical data of the photovoltaic power station and perform preprocessing to obtain a historical data set;
[0054] S2, selecting direct irradiance, diffuse irradiance and temperature data as clustering objects, and constructing a meteorological data vector set;
[0055] S3. Calculate the distance between data vector samples based on Mahalanobis distance;
[0056] S4. Select the partition entropy index as the criterion function, perform K-means clustering with different cluster numbers, calculate the partition entropy index of the clustering results under each cluster number, and find the optimal cluster number generated by the typical scenario;
[0057] S5. Selecting initial cluster centers based on the optimal number of clusters and K-means clustering method;
[0058] S6. The initial cluster centers are iterated by the fuzzy clustering method to generate typical photovoltaic scenarios.
[0059] In specific implementation, as a preferred embodiment of the present invention, in step S3, the calculation formula for calculating the distance between data vector samples is as follows:
[0060]
[0061] Among them, x a 、x b (a≠b) is the meteorological data, and M is the covariance matrix of x.
[0062] In specific implementation, as a preferred embodiment of the present invention, in step S4, the calculation formula for calculating the partition entropy index of the clustering results under each clustering number is as follows:
[0063]
[0064] Among them, PE represents the partition entropy index, N B is the number of meteorological data vectors, is the degree of membership of meteorological data j to the i-th cluster center when the number of clusters is k.
[0065] In specific implementation, as a preferred embodiment of the present invention, step S4, at the tth iteration, specifically includes:
[0066] S41. Initialize clustering parameters: the number of clusters is k, and the maximum number of clusters k is given max , The number of iterations is 0, the cluster center set is an empty set, and the number of elements in the cluster center set is 0;
[0067] S42, selecting any element from the meteorological data vector set, adding the selected element to the cluster center set, increasing the number of elements in the cluster center set by 1, and removing the selected element from the meteorological data vector set;
[0068] S43, traversing the elements of the meteorological data vector set, calculating the Mahalanobis distance between each element and the selected element, and obtaining a first Mahalanobis distance group;
[0069] S44, selecting the maximum value in the first Mahalanobis distance group, removing the element corresponding to the maximum value from the meteorological data vector set and adding it to the cluster center set, and the number of elements in the cluster center set is increased by 1;
[0070] S45, judging whether the number of elements in the cluster center set is less than the number of cluster centers, if so, returning to step S43; if so, executing step S46;
[0071] S46, calculating the Mahalanobis distance between the elements of the cluster center set and the elements of the meteorological data vector set to obtain a second Mahalanobis distance group, and summing the second Mahalanobis distance group to obtain the t-th iteration Mahalanobis distance value;
[0072] S47, judging whether the absolute value of the difference between the Mahalanobis distance value of the t-th iteration and the Mahalanobis distance value of the t-1-th iteration is less than or equal to a threshold value, if it is greater than the threshold value, entering the t+1-th iteration; if it is less than or equal to the threshold value, the iteration ends, and the cluster center set and the corresponding output data vector set are output as the initial cluster center of the cluster number;
[0073] S48. Calculate the partition entropy index of the clustering results under each clustering number according to the above clustering results;
[0074] S49. Calculate the curvature for different values of the number of clusters. When the curvature is the largest, the corresponding number of clusters is the optimal number of clusters:
[0075] S410. Based on the above optimal number of clusters, return to step S41 to calculate the clustering result under the optimal number of clusters.
[0076] In specific implementation, as a preferred embodiment of the present invention, step S5, at the tth iteration, specifically includes:
[0077] S51: Initialize clustering parameters: the number of cluster centers is k best , the number of iterations is 0, and the fuzzy weighting coefficient m = 2;
[0078] S52: According to the above initial cluster center, the membership of the cluster center element to the cluster center is calculated to obtain a membership matrix;
[0079] S53: Update cluster center;
[0080] S54: Determine whether the absolute value of the difference between the Mahalanobis distance value of the t-th iteration and the Mahalanobis distance value of the t-1-th iteration is less than or equal to a threshold value. If it is greater than the threshold value, enter the t+1-th iteration; if it is less than or equal to the threshold value, the iteration ends, and the cluster center set and the meteorological data vector set are output, and the output result is used as a typical photovoltaic scene.
[0081] In specific implementation, as a preferred embodiment of the present invention, in step S1, the acquired historical data of the photovoltaic power station is preprocessed, specifically including:
[0082] Find abnormal data in the data, eliminate biased data, and complete missing data.
[0083] Example
[0084] To verify the effectiveness of the method, the meteorological data and active output data of a photovoltaic power station in North China were selected to generate typical scenarios of the photovoltaic power station, and the LSTM prediction model was used to predict the photovoltaic output under each scenario. The capacity of this photovoltaic power station is 30MW. The statistical data are the output data and meteorological data of 10 photovoltaic power stations in 2022 from 8:00 to 16:00 throughout the year.
[0085] In some optional embodiments, the method provided by the present invention is used to extract direct irradiance, diffuse irradiance, and temperature data from the historical meteorological data of the photovoltaic power station to construct a meteorological data vector set, and a typical photovoltaic scene is generated based on an improved fuzzy clustering method. The typical scene results are as follows: Figure 2 shown.
[0086] In order to verify the quality of the generated typical photovoltaic scenes, the proposed method is compared with the traditional fuzzy clustering method. The clustering results are evaluated using two indicators: running time and variance ratio criterion. The calculation formula of the variance ratio criterion CH is as follows:
[0087]
[0088] Among them, B k is the covariance matrix between classes, W k is the covariance matrix within the class. The larger the variance ratio criterion, the better the clustering effect.
[0089] The comparison results are shown in Table 1. As can be seen from the table, compared with the traditional fuzzy clustering method, the variance ratio criterion of the method of the present invention is significantly improved under the condition of shorter running time, indicating that the clustering quality of the method of the present invention is higher.
[0090] Table 1. Comparison results
[0091]
[0092] After generating typical photovoltaic scenarios, the LSTM prediction model is input to predict the photovoltaic output under each scenario. The prediction results are as follows: Figure 3 The results show that when the method of the present invention is applied to prediction, it has a higher prediction accuracy and a high similarity with the measured output, thus improving the prediction accuracy.
[0093] In addition, to further verify whether the method of the present invention improves the prediction accuracy, the method of the present invention is compared with the LSTM prediction model without data processing. The prediction results of the two models are compared using RMSE and MSE indicators. Figure 4 As shown in the comparison results Figure 4It can be seen that the photovoltaic typical scene generation method based on improved fuzzy clustering proposed in the present invention has higher prediction accuracy when predicting photovoltaic output for the LSTM model than the traditional prediction model without data processing.
[0094] Among them, the error evaluation index e RMSE and e MAE The calculation formula is as follows:
[0095]
[0096] Where P t is the measured output, P t,fore To predict the output, C ap is the power station capacity, and N is the total number of predicted output time points.
[0097] In summary, in order to better meet the dispatching needs of the power system, the present invention proposes a photovoltaic typical scene generation method based on improved fuzzy clustering, extracts meteorological data that affects photovoltaic output from historical data, and generates typical scenes that conform to actual operating conditions according to the improved fuzzy clustering method. Compared with the photovoltaic output prediction model of unprocessed data, the output prediction accuracy is improved.
[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A photovoltaic typical scene generation method based on improved fuzzy clustering, characterized in that: include: S1. Obtain historical data of the photovoltaic power station and perform preprocessing to obtain a historical data set; S2, selecting direct irradiance, diffuse irradiance and temperature data as clustering objects, and constructing a meteorological data vector set; S3. Calculate the distance between data vector samples based on Mahalanobis distance; S4, select the partition entropy index as the criterion function, perform K-means clustering with different cluster numbers, calculate the partition entropy index of the clustering results under each cluster number, and find the optimal cluster number generated by the typical scenario; S5. Selecting initial cluster centers based on the optimal number of clusters and K-means clustering method; S6. The initial cluster centers are iterated by the fuzzy clustering method to generate typical photovoltaic scenarios.
2. A photovoltaic typical scene generation method based on improved fuzzy clustering according to claim 1, characterized in that: In step S3, the calculation formula for calculating the distance between data vector samples is as follows: Among them, x a 、x b (a≠b) is the meteorological data, and M is the covariance matrix of x.
3. The photovoltaic typical scene generation method based on improved fuzzy clustering according to claim 1, characterized in that: In step S4, the calculation formula for calculating the partition entropy index of the clustering results under each cluster number is as follows: Among them, PE represents the partition entropy index, N B is the number of meteorological data vectors, is the degree of membership of meteorological data j to the i-th cluster center when the number of clusters is k.
4. The photovoltaic typical scene generation method based on improved fuzzy clustering according to claim 1, characterized in that: Step S4, at the tth iteration, specifically includes: S41. Initialize clustering parameters: the number of clusters is k, and the maximum number of clusters k is given max , The number of iterations is 0, the cluster center set is an empty set, and the number of elements in the cluster center set is 0; S42, selecting any element from the meteorological data vector set, adding the selected element to the cluster center set, increasing the number of elements in the cluster center set by 1, and removing the selected element from the meteorological data vector set; S43, traversing the elements of the meteorological data vector set, calculating the Mahalanobis distance between each element and the selected element, and obtaining a first Mahalanobis distance group; S44, selecting the maximum value in the first Mahalanobis distance group, removing the element corresponding to the maximum value from the meteorological data vector set and adding it to the cluster center set, and the number of elements in the cluster center set is increased by 1; S45, judging whether the number of elements in the cluster center set is less than the number of cluster centers, if so, returning to step S43; if so, executing step S46; S46, calculating the Mahalanobis distance between the elements of the cluster center set and the elements of the meteorological data vector set to obtain a second Mahalanobis distance group, and summing the second Mahalanobis distance group to obtain the t-th iteration Mahalanobis distance value; S47, judging whether the absolute value of the difference between the Mahalanobis distance value of the t-th iteration and the Mahalanobis distance value of the t-1-th iteration is less than or equal to a threshold value, if it is greater than the threshold value, entering the t+1-th iteration; if it is less than or equal to the threshold value, the iteration ends, and the cluster center set and the corresponding output data vector set are output as the initial cluster center of the cluster number; S48. Calculate the partition entropy index of the clustering results under each clustering number according to the above clustering results; S49. Calculate the curvature for different values of the number of clusters. When the curvature is the largest, the corresponding number of clusters is the optimal number of clusters: S410. Based on the above optimal number of clusters, return to step S41 to calculate the clustering result under the optimal number of clusters.
5. The photovoltaic typical scene generation method based on improved fuzzy clustering according to claim 1, characterized in that: Step S5, at the tth iteration, specifically includes: S51: Initialize clustering parameters: the number of cluster centers is k best , the number of iterations is 0, and the fuzzy weighting coefficient m = 2; S52: According to the above initial cluster center, the membership of the cluster center element to the cluster center is calculated to obtain a membership matrix; S53: Update cluster center; S54: Determine whether the absolute value of the difference between the Mahalanobis distance value of the t-th iteration and the Mahalanobis distance value of the t-1-th iteration is less than or equal to a threshold value. If it is greater than the threshold value, enter the t+1-th iteration; if it is less than or equal to the threshold value, the iteration ends, and the cluster center set and the meteorological data vector set are output, and the output result is used as a typical photovoltaic scene.
6. The photovoltaic typical scene generation method based on improved fuzzy clustering according to claim 1, characterized in that: In step S1, the acquired historical data of the photovoltaic power station is preprocessed, specifically including: Find abnormal data in the data, eliminate biased data, and complete missing data.