Improved DTW-KMeans clustering algorithm for wind power typical scene extraction
By improving the DTW-KMeans algorithm, introducing probability difference compensation and load characteristic optimization, typical wind power scenarios are generated, solving the problem of loss of wind power volatility characteristics and improving the accuracy and universality of grid peak-shaving strategies.
Patent Information
- Application Number
- CN202511091588.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-11-11
AI Technical Summary
The existing DTW-KMeans algorithm cannot effectively preserve the fluctuation characteristics of wind power in wind power output prediction, which limits its applicability in grid peak shaving and dispatch.
By improving the DTW-KMeans algorithm, probabilistic difference compensation and load characteristic optimization are introduced to generate typical wind power scenarios. This includes steps such as randomly generating the initial centroid, dividing the DTW distance, fitting the difference probability distribution, and adjusting the weight coefficients, and optimizing the centroid curve to reflect the volatility of wind power.
While preserving the morphological characteristics of the centroid curve, it improves the reflection of wind power volatility in typical scenarios, thereby enhancing the accuracy and universality of grid peak-shaving strategies.
Smart Images

Figure CN120929863A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wind power generation typical output scenario construction technology, and in particular to an improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios. Background Technology
[0002] With the accelerated construction of new power systems, the integration of high proportions of renewable energy into the grid places higher demands on the flexibility and stability of the power grid. Wind power, as an important component of renewable energy, exhibits significant randomness, intermittency, and volatility in its output, posing new challenges to peak shaving and dispatching of the power grid. Therefore, the coordinated optimization of wind power with thermal power and other energy systems has become a widely researched topic, and clustering to obtain typical scenarios has extensive applications in multi-energy system optimization research.
[0003] The DTW-KMeans algorithm is an improvement on the traditional K-Means algorithm. However, it is still essentially a generalized form of averaging, and therefore still suffers from the significant drawback of its centroid curve exhibiting a smooth trajectory and losing the volatile characteristics of wind power generation. Since volatility is one of the most important characteristics of wind power, the engineering applicability of the curve obtained by this algorithm is limited. Summary of the Invention
[0004] Therefore, the purpose of this invention is to provide an improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios, so as to at least solve the above problems.
[0005] The technical solution adopted in this invention is as follows: An improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios includes the following steps: Step 1: Determine the number of clusters K, and randomly generate initial centroids; Step 2: Using the DTW-KMeans clustering method, iterate until the centroids converge, divide the historical wind power generation data into different clusters, and obtain the centroid curves of each cluster; Step 3: Calculate the difference between the actual running curve and the centroid curve in each cluster at each time step, and construct the probability distribution function of the difference; Step 4: Perform difference compensation on the centroid curves obtained from clustering based on the probability distribution function. At each time step of the centroid curve, the difference is randomly applied according to the probability distribution of the difference. Step 5: Add weighting coefficients to the applied difference and optimize the compensation curve to obtain a typical wind power generation scenario.
[0006] Furthermore, step 1, which randomly generates the initial centroid, specifically involves: acquiring historical wind power generation data and generating the initial centroid in the densely distributed area of the wind power data based on the distribution characteristics of the wind power data in the historical wind power generation data.
[0007] Further, step 2 specifically involves: calculating the DTW distance between the wind power curve of each historical wind power generation data and each centroid curve, dividing each curve into the cluster to which the centroid with the smallest DTW distance belongs, recalculating the centroid of each cluster, and obtaining the centroid curve of each cluster.
[0008] Furthermore, step 3 specifically involves: The difference between the actual operating curve and the centroid curve of each cluster is calculated. The probability distribution of this difference is then fitted using Gaussian kernel density estimation to generate a probability density function that describes the randomness of the cluster's data deviation at that given moment. The Gaussian kernel density estimation formula is as follows:
[0009] in, express, Indicates the smoothing parameter. Indicates the number of samples. Indicates the first One sample point, Point The estimated probability density value.
[0010] Furthermore, step 4 specifically involves: generating bias data based on the probability density function generated by Gaussian kernel density estimation, and then superimposing the bias data onto the centroid curve to obtain the compensation curve.
[0011] Furthermore, step 5 specifically involves: adding weighting coefficients to the superimposed deviation data, performing load characteristic analysis on the obtained compensation curve and the actual curve in each cluster, optimizing the compensation curve by adjusting the weighting coefficients, so that the load characteristics of the optimized compensation curve and the actual curve tend to be consistent, and finally obtaining a typical wind power generation scenario.
[0012] Furthermore, load characteristic analysis is performed on the obtained compensation curves and the actual curves in each cluster. Specifically, load characteristic analysis is conducted using the probability density function of wind power fluctuation.
[0013] in, express Wind power output at any given time Indicates the sampling time interval. This indicates the rated power of the fan. This indicates the magnitude of wind power fluctuations.
[0014] Compared with the prior art, the beneficial effects of the present invention are: This invention provides an improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios. By optimizing the algorithm through probability difference compensation and load characteristic comparison, the algorithm reflects the wind power volatility in the actual operation process into typical scenarios while preserving the DTW-KMeans clustering morphological characteristics. This provides high-fidelity scenario input for the formulation of grid peak-shaving strategies, improving the accuracy and universality of optimization. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only preferred embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the method flow provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the clustering results of the conventional DTW-KMeans algorithm provided in the embodiments of the present invention; Figure 3 This is a schematic diagram showing the distribution of the difference between the actual curve and the centroid curve in scenario 1 provided by an embodiment of the present invention; Figure 4 This is a schematic diagram of the centroid curve after probability difference compensation in scenario 1 provided in this embodiment of the invention; Figure 5 This is a schematic diagram of the actual curve fluctuation probability distribution provided in the embodiment of the present invention for scenario 1; Figure 6 This is a schematic diagram of the fluctuation probability distribution of the compensation curve in scenario 1 provided by an embodiment of the present invention; Figure 7 This is a schematic diagram of the optimized compensation curve for scenario 1 provided in this embodiment of the invention; Figure 8 This is a schematic diagram of the fluctuation probability distribution of the compensation curve after optimization in scenario 1 provided by the embodiment of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. In the following description, the expression "some embodiments" refers to a subset of all possible embodiments; however, it should be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.
[0018] In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the invention. However, it will be apparent to those skilled in the art that the invention can be practiced without one or more of these details. In other instances, certain technical features well-known in the art have not been described in order to avoid obscuring the invention.
[0019] It should be understood that the present invention can be embodied in various forms and should not be construed as being limited to the embodiments set forth herein. Rather, providing these embodiments will make the disclosure thorough and complete, and will fully convey the scope of the invention to those skilled in the art. Furthermore, the terminology used herein is intended only to describe particular embodiments and is not intended to limit the invention. When used herein, the singular forms “a,” “an,” and “the” are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “compose” and / or “comprising,” when used in this specification, identify the presence of the stated features, integers, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups. When used herein, the term “and / or” includes any and all combinations of the associated listed items.
[0020] It should also be noted that when an element is referred to as being "fixed to" another element, it can be directly attached to the other element or there may be an intervening element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or there may be an intervening element. The terms "vertical," "horizontal," "inner," "outer," "left," "right," and similar expressions used herein are for illustrative purposes only and do not represent the only possible implementation.
[0021] The principles and features of the present invention are described below with reference to the accompanying drawings. The listed embodiments are only used to explain the present invention and are not intended to limit the scope of the present invention.
[0022] Reference Figure 1This invention provides an improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios, comprising the following steps: Step 1: Determine the number of clusters K, and randomly generate initial centroids, specifically: Obtain historical wind power generation data, and generate initial centroids in areas with dense data distribution based on the distribution characteristics of wind power data in the historical wind power generation data.
[0023] Step 2: Using the DTW-KMeans clustering method, iterate until the centroids converge, dividing the historical wind power generation data into different clusters, and obtaining the centroid curves of each cluster, specifically: Calculate the DTW distance between the wind power curve of each historical wind power generation data and each centroid curve, divide each curve into the cluster to which the centroid with the smallest DTW distance belongs, recalculate the centroid of each cluster, and obtain the centroid curve of each cluster.
[0024] Step 3: Calculate the difference between the actual running curve and the centroid curve in each cluster at each time step, and construct the probability distribution function of the difference; specifically: The difference between the actual operating curve and the centroid curve of each cluster is calculated. The probability distribution of this difference is then fitted using Gaussian kernel density estimation to generate a probability density function that describes the randomness of the cluster's data deviation at that given moment. The Gaussian kernel density estimation formula is as follows:
[0025] in, express, Indicates the smoothing parameter. Indicates the number of samples. Indicates the first One sample point, Point The estimated probability density value.
[0026] Step 4: Perform difference compensation on the centroid curves obtained from clustering based on the probability distribution function. At each time step of the centroid curve, a difference is randomly applied according to the probability distribution of the difference; specifically: Based on the probability density function generated by Gaussian kernel density estimation, bias data is generated by random sampling, and the bias data is superimposed on the centroid curve to obtain the compensation curve.
[0027] Step 5: Add weighting coefficients to the applied difference and optimize the compensation curve to obtain a typical wind power generation scenario. Specifically: By adding weighting coefficients to the superimposed deviation data, load characteristic analysis is performed on the obtained compensation curve and the actual curve in each cluster. The compensation curve is optimized by adjusting the weighting coefficients so that the load characteristics of the optimized compensation curve and the actual curve tend to be consistent, and finally a typical wind power generation scenario is obtained.
[0028] The load characteristic analysis of the obtained compensation curves and the actual curves in each cluster is specifically performed by using the probability density function of wind power fluctuations.
[0029] in, express Wind power output at any given time Indicates the sampling time interval. This indicates the rated power of the fan. This indicates the magnitude of wind power fluctuations.
[0030] For example, one of the most critical characteristics of wind power load is the volatility of wind power output. Therefore, the probability density of wind power volatility is introduced to measure wind power volatility. The wind power fluctuation power is the percentage of wind power output change relative to the rated power of the wind turbine, reflecting the magnitude of wind power fluctuation.
[0031] This embodiment performs cluster analysis on the annual operation data of several wind farms in a certain region of Yunnan in 2024. The clustering structure using the conventional DTW-KMeans algorithm is shown below. Figure 2 As shown, when the number of clusters is K=4, the four centroid curves obtained by clustering the intraday characteristics of wind power throughout the year exhibit volatility, but also have many smooth segments in many time periods. These smooth segments smooth out the volatility characteristics of wind power generation to a certain extent, which does not match the actual volatility characteristics of wind power output and cannot accurately reflect the wind power output scenario.
[0032] The method of this invention is used to compensate and optimize the clustered curves. Taking scenario 1 (i.e., cluster 0) as an example, this scenario includes 79 days of wind power curves. First, the difference between each actual wind power curve in the cluster of scenario 1 and the centroid curve obtained by the traditional clustering method is calculated, resulting in 79 difference curves. Then, at each sampling time, Gaussian kernel density estimation (KDE) is used to fit the probability distribution of the difference data at that time, and its statistical distribution is calculated, such as... Figure 3 As shown; Next, based on the probability distribution of the difference curves, difference compensation is performed on the centroid curves. The compensated clustering curves are as follows: Figure 4As shown in the figure, it can be seen that after compensation using the probability distribution of the difference between the actual curve and the centroid curve, the volatility of the curve increases significantly, while the shape of the centroid curve is preserved to some extent. However, due to the large difference between the actual curves and the centroid curves in the clustering results, the compensation for the original centroid curve is also significant. Coupled with the influence of randomness, the new curve exhibits excessive volatility, clearly not reflecting reality and obscuring the original characteristics of the curve. Therefore, this invention further optimizes the compensation curve by incorporating the probability distribution of volatility. Calculate the volatility probability distribution of the actual operating data and the volatility probability distribution of the compensation curve, respectively. The distributions are as follows: Figure 5 and Figure 6 As shown; The comparison revealed that excessive difference compensation was applied to the centroid curve. Figure 6 The curve volatility is much greater than Figure 5 The actual curve fluctuates, so the new curve after compensation amplifies the fluctuations of wind power generation and cannot accurately reflect the characteristics of the actual curve.
[0033] This invention introduces a coefficient k (k < 1) into the applied random perturbation, so that the probability distribution of volatility is close to the probability distribution of the actual curve in scenario 1. This not only preserves the characteristics of the centroid curve, but also better reflects the volatility of the actual curve in scenario 1. After setting an appropriate coefficient k, the volatility probability distributions of the optimized curve and the optimized curve are shown below. Figure 7 and Figure 8 As shown; As can be seen, the compensation curve optimized by adjusting the coefficient k retains all the characteristics of the centroid curve while also reflecting the continuous fluctuations inherent in the actual wind power generation process. However, since the original centroid curve has several large peaks, the 95% confidence interval for the volatility probability distribution (see...) Figure 8 Compared to the actual curve (see...) Figure 5 The initial volatility was relatively high, but the optimized volatility probability distribution is now quite close to the actual curve in terms of characteristics. Thus, the final typical wind power output scenario 1 was obtained.
[0034] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios, characterized in that, Includes the following steps: Step 1: Determine the number of clusters K, and randomly generate initial centroids; Step 2: Using the DTW-KMeans clustering method, iterate until the centroids converge, divide the historical wind power generation data into different clusters, and obtain the centroid curves of each cluster; Step 3: Calculate the difference between the actual running curve and the centroid curve in each cluster at each time step, and construct the probability distribution function of the difference; Step 4: Perform difference compensation on the centroid curves obtained from clustering based on the probability distribution function. At each time step of the centroid curve, the difference is randomly applied according to the probability distribution of the difference. Step 5: Add weighting coefficients to the applied difference and optimize the compensation curve to obtain a typical wind power generation scenario.
2. The improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios according to claim 1, characterized in that, Step 1, randomly generating the initial centroid, specifically involves: acquiring historical wind power generation data, and generating the initial centroid in the densely distributed area of the wind power data based on the distribution characteristics of the wind power data in the historical wind power generation data.
3. The improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios according to claim 2, characterized in that, Step 2 specifically involves: calculating the DTW distance between the wind power curve of each historical wind power generation data and each centroid curve, dividing each curve into the cluster to which the centroid with the smallest DTW distance belongs, recalculating the centroid of each cluster, and obtaining the centroid curve of each cluster.
4. The improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios according to claim 3, characterized in that, Step 3 specifically involves: The difference between the actual operating curve and the centroid curve of each cluster is calculated. The probability distribution of this difference is then fitted using Gaussian kernel density estimation to generate a probability density function that describes the randomness of the cluster's data deviation at that given moment. The Gaussian kernel density estimation formula is as follows: in, express, Indicates the smoothing parameter. Indicates the number of samples. Indicates the first One sample point, Point The estimated probability density value.
5. The improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios according to claim 4, characterized in that, Step 4 specifically involves generating bias data based on the probability density function generated by Gaussian kernel density estimation, and then superimposing the bias data onto the centroid curve to obtain the compensation curve.
6. The improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios according to claim 5, characterized in that, Step 5 specifically involves adding weighting coefficients to the superimposed deviation data, performing load characteristic analysis on the obtained compensation curve and the actual curve in each cluster, optimizing the compensation curve by adjusting the weighting coefficients, so that the load characteristics of the optimized compensation curve and the actual curve tend to be consistent, and finally obtaining a typical wind power generation scenario.
7. The improved DTW-KMeans clustering algorithm for extracting typical wind power scenarios according to claim 6, characterized in that, The load characteristic analysis of the obtained compensation curves and the actual curves in each cluster is specifically performed by using the probability density function of wind power fluctuations. in, express Wind power output at any given time Indicates the sampling time interval. This indicates the rated power of the fan. This indicates the magnitude of wind power fluctuations.
Citation Information
Patent Citations
Offshore wind plant energy storage system optimal configuration method based on cloud model and FCM algorithm
CN112668764A
Power load prediction method and system based on deep learning and considering multiple influence factors
CN115018200A
Wind power typical scene construction method and system under multi-characteristic quantity index based on improved K-means algorithm
CN115344996A
Scene generation method considering distributed power supply and load output uncertainty
CN116662843A
Photovoltaic typical output scene clustering method considering comprehensive similarity measurement
CN116992319A