A Wind Power Prediction Method Based on WRF-CFD Simulation and Attention Mechanism Architecture Model
Through the combination of WRF-CFD simulation and attention mechanism architecture model, the wind power prediction is used to use RF-VMD-PCA and TCN-SENet-BiLSTM-GAM models to perform wind power prediction, solving the problems of high computing costs and insufficient accuracy in the prior art, and achieving efficient and reliable wind power prediction.
Patent Information
- Application Number
- CN202411264240.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2044-09-10
AI Technical Summary
The existing wind power prediction methods rely on the output of the WRF model to result in high computational cost and insufficient accuracy and reliability, and limited applicability in different situations.
WRF-CFD simulation combined with attention mechanism architecture model is adopted, feature pre-processing is performed through the RF-VMD-PCA model, and the meteorological factor data is corrected using the TCN-SENet-BiLSTM-GAM error correction model to establish a medium-micro-scale topographic model of the wind farm and a fan power database to accurately predict wind speed and wind direction.
It improves the accuracy and comprehensiveness of wind power prediction, reduces calculation costs, provides reliable prediction support in various situations, and significantly improves the accuracy of wind power prediction in wind farms.
Smart Images

Figure CN119168416B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wind power prediction, and particularly relates to a wind power prediction method based on WRF-CFD simulation and attention mechanism architecture model. Background Art
[0002] With the wide application and continuous development of renewable energy, wind energy, as a clean renewable energy, has been widely used in the power generation field. A wind farm is a facility that converts wind energy into electrical energy using wind turbines (abbreviated as wind turbines). A wind farm generally includes multiple wind turbines, a wind measurement tower, a tower, an inverter, a control system, etc. The wind turbine is the core part of the wind farm and usually consists of three main parts: blades, a hub, and a generator. The wind measurement tower is mainly used to collect wind energy resource data within the target wind farm. These data are crucial for analyzing the wind energy potential of the wind farm, wind turbine selection, layout scheme, and annual power generation calculation. However, due to the randomness, volatility, intermittency, and uncertainty of wind power, it poses significant challenges to grid integration, power dispatching, and regulation. Therefore, accurate and reliable wind power prediction is crucial for grid dispatching and energy management.
[0003] Currently, coupling the WRF and CFD models is regarded as a better method to solve micro-scale wind farm problems. However, existing methods mainly rely on using the output of WRF as boundary conditions for downscaling simulation, which leads to a large amount of computational cost and time overhead. At the same time, the accuracy and reliability of the WRF model face challenges in model input, parameter selection, and uncertainty. Most current research on improving the prediction accuracy of the WRF model is based on complex physical principles. However, it should be noted that these model constructions are for specific situations, so there may be certain applicability limitations in other situations. Summary of the Invention
[0004] Aiming at the above deficiencies existing in the prior art, the technical problem to be solved by the present invention is: how to provide a wind power prediction method based on WRF-CFD simulation and attention mechanism architecture model that can effectively improve the accuracy of wind power prediction and improve the mesoscale WRF predicted wind speed error.
[0005] To solve the above technical problems, the present invention adopts the following technical solutions:
[0006] A wind power prediction method based on WRF-CFD simulation and attention mechanism architecture model, comprising the following steps:
[0007] Step 1) Collect information of the wind farm, and the information of the wind farm includes wind speed, wind direction, wind turbine power, and terrain data;
[0008] Step 2) Use the WRF Weather Research and Forecasting Model to predict and output the meteorological element data of the wind farm for the target location of the wind farm;
[0009] Step 3) According to the terrain data of the wind farm target location, the positions of the wind measurement towers and each wind turbine, establish a CFD micro-scale terrain model of the wind farm target location, conduct CFD wind field simulations for 16 wind directions, and at the same time establish a database from the wind speed and wind direction of the wind measurement tower to the power of each wind turbine in combination with the power curves of each wind turbine;
[0010] Step 6) Establish an RF-VMD-PCA model, and use the RF-VMD-PCA model to perform feature preprocessing on the meteorological element data predicted in Step 2);
[0011] Step 9) Establish an error correction model based on the attention mechanism architecture, and use the meteorological element data after feature preprocessing in Step 4) as the input of the error correction model to correct the predicted meteorological element data in Step 2);
[0012] Step 12) Use the wind speed of the wind measurement tower corrected in Step 5) and the wind direction data predicted by the WRF model, and combine the CFD database obtained in Step 3) to predict the power of the wind farm;
[0013] Step 15) Evaluate the performance of the predicted results of the corrected wind speed of the wind measurement tower and the wind farm power.
[0014] Preferably, in Step 1), for the missing and outlier data of the wind speed and wind direction of the wind farm, linear interpolation is used for filling;
[0015] For the missing and outlier data of the wind turbine power, after linearly interpolating and filling the wind speed, it is then estimated and filled by the wind turbine power curve.
[0016] Preferably, in Step 2), the target location of the wind farm is the wind measurement tower of the wind farm. Use the output of the Global Forecast System model as the initial boundary condition and lateral boundary condition for the operation of the WRF Weather Research and Forecasting Model. The WRF Weather Research and Forecasting Model predicts and outputs the meteorological element data of the wind farm for the target location of the wind farm. The meteorological element data includes wind speed, wind direction, air pressure, temperature, and humidity.
[0017] Preferably, in step 3), the simulation input of the CFD micro-scale terrain model is the wind profile of Class B terrain. The Realizable k-ε turbulence model is adopted. The inlet wind speeds at the hub height of the wind turbines are set to 3 m / s, 5 m / s, 7 m / s, 9 m / s, 11 m / s, 15 m / s, and 19 m / s respectively. The wind direction is divided into 16 intervals, each interval being 22.5 degrees, and a total of 112 simulation conditions are created. The simulation output of the CFD micro-scale terrain model includes the wind speed of the anemometer tower, the wind direction of the anemometer tower, and the wind speeds at the hub heights of each wind turbine, and the power of each wind turbine is calculated using the wind turbine power curve.
[0018] Preferably, step 4) includes the following steps:
[0019] Step 4.1) Use the random forest algorithm to screen out the meteorological element data closely related to the historical measured wind speed from the meteorological element data predicted by the WRF Weather Research and Forecasting Model as the input meteorological element data;
[0020] Step 4.2) Use the variational mode decomposition algorithm to decompose the wind speed error in the input meteorological element data to obtain the prediction error subsequences;
[0021] Step 4.3) Use the principal component analysis method to extract the principal components of the prediction error subsequences, enrich the characteristics of the prediction sequence, and complete the preprocessing of the characteristics of the meteorological element data.
[0022] Preferably, step 4.1) includes the following steps:
[0023] Step 4.1.1) Randomly draw subsets from the original meteorological element data through the bootstrap method, and create decision trees based on these subsets to construct a random forest model;
[0024] Step 4.1.2) When constructing each decision tree, resample the meteorological element data to train the decision tree, and leave a set number of meteorological element data as out-of-bag data OOB. For each decision tree, calculate the out-of-bag error rate ERR of the model OOB1 to evaluate the performance of the decision tree;
[0025] Step 4.1.3) Randomly add noise interference to the meteorological element data X in the out-of-bag data OOB, and then recalculate the out-of-bag error rate ERR OOB2 ;
[0026] Step 4.1.4) Assume there are N trees in the random forest, then the importance imp of each meteorological element data X X is expressed by the following formula:
[0027] imp X = ∑(ERR OOB2 - ERROOB1 ) / N;
[0028] Step 4.1.5) Select the importance imp X Meteorological element data greater than 1.5% are used as the input meteorological element data.
[0029] Preferably, step 4.2) includes the following steps:
[0030] Step 4.2.1) Use the VMD constrained variational model to adaptively determine the relevant frequency scales and estimate the corresponding mode functions by establishing and solving a variational problem. The VMD constrained variational model is as follows:
[0031]
[0032] In the formula: k is the total number of modes after decomposition, f is the original signal, u k ={u1, u2,..., u k} are the mode functions, ω k ={ω1, ω2,..., ω k} are the central frequencies of each mode, is the partial derivative with respect to time t, δ(t) is the Dirac δ function, which is usually 1 at time 0 and 0 at other times, j is the imaginary unit, t is time; u k (t) is the change of the k-th mode function with time t, and s is the constraint condition;
[0033] An augmented Lagrangian function is introduced for constrained optimization:
[0034]
[0035] In the formula: α is the penalty parameter, λ is the Lagrange multiplier, f(t) is the original signal, and λ(t) is the Lagrange multiplier used to introduce the constraint condition;
[0036] Step 4.2.2) Use the alternating direction method of multipliers to update the mode function u k , the central frequency ω k and the Lagrange multiplier λ:
[0037]
[0038] In the formula: τ is the noise tolerance rate, ω is the frequency, is the estimate of the k-th mode function for the frequency ω in the (n + 1)-th iteration, f(ω) is the frequency domain of the original signal, is the estimate of the i-th mode function for the frequency ω in the (n + 1)-th iteration, is the estimate of the Lagrange multiplier for the frequency ω in the n-th iteration, For the update of the central frequency of the k-th mode function at the (n + 1)-th iteration, is the frequency domain of the original signal;
[0039] Step 4.2.3) Repeat Step 4.2.2) until the mode function u k , the central frequency ω k and the Lagrange multiplier λ meet the set conditions and stop the update to achieve the decomposition of the wind speed error predicted by the variational mode decomposition algorithm for the WRF weather research and forecasting model;
[0040]
[0041] where: ε is the tolerance of the convergence criterion. Repeat the update of the mode function, central frequency, and Lagrange multiplier until the tolerance ε of the convergence criterion is met and stop the update. The tolerance represents the condition for stopping the update;
[0042] Step 4.2.4) Decompose to obtain 12 prediction error subsequences.
[0043] Preferably, Step 4.3) includes the following steps:
[0044] Step 4.3.1) Center all samples, that is, subtract the mean of the sample set from each sample x (i) .
[0045] Step 4.3.2) Calculate the covariance matrix XX T ;
[0046] Step 4.3.3) Perform eigenvalue decomposition on the covariance matrix XX T ;
[0047] Step 4.3.4) Determine the number of principal components n' after dimensionality reduction. By setting a proportion threshold t ∈ (0, 1], determine the number of principal components according to the proportion of eigenvalues. For example, if n eigenvalues are λ1 ≥ λ2 ≥ … ≥ λ n , then n' is determined as follows:
[0048]
[0049] Step 4.3.5) Obtain the eigenvectors (w1, w2, …, w n′ ) corresponding to n' eigenvalues and standardize them to form the eigenvector matrix W;
[0050] Step 4.3.6) For each sample x (i) in the sample set, perform the following transformation:
[0051] z (i) = W T x (i)
[0052] Obtain the reduced - dimensional sample set \(D'=(z (1) ,z (2) ,…,z (m) );
[0053] Where: \(W T is the transpose of the eigenvector matrix \(W\);
[0054] Step 4.3.7) Take the principal components of the first 5 error subsequences from the reduced - dimensional sample set \(D'\) as the input features of the subsequent error correction model.
[0055] Preferably, in step 5), establish a TCN - SENet - BiLSTM - GAM error correction model based on the attention mechanism architecture, which specifically includes the following steps:
[0056] Step 5.1) Use a series of temporal convolutional layers of the Temporal Convolutional Network (TCN) to capture sequence patterns at different time scales, and introduce a Channel Attention Mechanism (SENet) module into the output of the TCN to adaptively adjust the weights of channel features, which helps to extract spatial features related to the prediction target in the multi - feature sequence;
[0057] Step 5.2) Simultaneously perform forward and backward modeling on the sequence through the Bidirectional Long Short - Term Memory Network (BiLSTM) to capture the dependencies in the sequence. At the same time, apply the Global Attention Mechanism (GAM) to weight the output of the BiLSTM to extract the global time - domain features related to the prediction target in the multi - feature sequence;
[0058] Step 5.3) Stack and fuse the spatial features and global time - domain features extracted in steps 5.1) and 5.2). Subsequently, these fused features are fed into a fully - connected layer for processing, thus completing the construction of the TCN - SENet - BiLSTM - GAM error correction model.
[0059] Step 5.4) Use all the features after feature pre - processing in step 4) as the input of the TCN - SENet - BiLSTM - GAM error correction model to obtain the decomposed WRF error subsequences by Variational Mode Decomposition (VMD), sum them to obtain the prediction error of the Weather Research and Forecasting (WRF) model, and combine it with the prediction data of the WRF model to reversely correct the prediction error of the WRF model.
[0060] Preferably, in step 7), use the Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and Mean Absolute Percentage Error (MAPE) as performance evaluation indicators to evaluate the results of the error correction of the wind speed at the wind measurement tower and the power prediction results of the wind farm. The calculation formulas of these indicators are as follows:
[0061]
[0062]
[0063] In the formula: N represents the number of samples, y i represents the true value at the i-th moment, represents the predicted value at the i-th moment.
[0064] Compared with the prior art, the present invention has the following advantages:
[0065] 1. The method of coupling WRF-CFD simulation in this solution comprehensively considers atmospheric dynamics and hydrodynamic phenomena, can more comprehensively describe the wind farm situation, and improves the comprehensiveness and reliability of prediction. At the same time, the proposed meso-microscale simulation method effectively solves the problem of low downscaling coupling efficiency and improves the efficiency and practicability of the prediction model.
[0066] 2. Compared with only relying on physical principles for improvement, prediction errors are inevitable in wind energy prediction. This solution improves the prediction accuracy of the mesoscale WRF model by combining machine learning methods. This method has wide applicability and can provide reliable and accurate wind power prediction support in various scenarios.
[0067] 3. This solution combines multiple algorithms such as random forest, variational mode decomposition, and principal component analysis through the RF-VMD-PCA model, realizes efficient feature preprocessing of meteorological element data, screens out meteorological element data closely related to historical measured wind speeds from the meteorological element data predicted by the WRF weather research and forecasting model, and extracts the principal components of the prediction error subsequence, thereby fully enriching the features of the prediction sequence and effectively improving the accuracy and comprehensiveness of the prediction model.
[0068] 4. The error correction model based on the attention mechanism architecture in this solution is based on the time convolutional network TCN and the bidirectional long short-term memory network BiLSTM, combines the channel attention mechanism SENet and the global attention mechanism Global Attention, can comprehensively model the spatio-temporal features of multi-feature sequences, realizes efficient processing of complex sequence data, and its adaptive feature weight adjustment and comprehensive feature fusion make the model pay more attention to the important features related to the prediction target and fully integrate the information of different features in the prediction model, thereby improving the perception ability, prediction effect, and accuracy of the model.
[0069] 5. This solution can significantly improve the accuracy of wind power prediction by using the meso-microscale coupling method and the wind speed error correction model based on the attention mechanism architecture, thereby providing more reliable support for power grid integration, power dispatch, and regulation. Description of the Drawings
[0070] Appendix Figure 1 It is a schematic flowchart of the wind power prediction method based on the WRF-CFD simulation and attention mechanism architecture model of the present invention;
[0071] Appendix Figure 2 It is the anemometer tower location, altitude and model domain range of the wind farm in the wind power prediction method based on the WRF-CFD simulation and attention mechanism architecture model of the present invention;
[0072] Appendix Figure 3 It is the error correction model based on the attention mechanism TCN-SENet-BiLSTM-GAM in the wind power prediction method based on the WRF-CFD simulation and attention mechanism architecture model of the present invention. Detailed implementation manners
[0073] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. Components of the embodiments of the present invention usually described and illustrated in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed present invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0074] It should be noted that similar reference numerals and letters indicate similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In the description of the present invention, it should be noted that the orientation or positional relationship indicated by terms such as "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the figures, or the orientation or positional relationship in which the inventive product is customarily placed during use. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation to the present invention. In addition, terms such as "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance. In addition, terms such as "horizontal" and "vertical" do not mean that the components are required to be absolutely horizontal or hanging, but can be slightly inclined. For example, "horizontal" only means that its direction is more horizontal relative to "vertical", and does not mean that the structure must be completely horizontal, but can be slightly inclined. In the description of the present invention, it should also be noted that unless otherwise clearly specified and limited, the terms "set", "installed", "connected", "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0075] As shown in the Figure 1 accompanying drawings, a wind power prediction method based on a WRF-CFD simulation and an attention mechanism architecture model includes the following steps:
[0076] Step 1) Collect information of the wind farm. The information of the wind farm includes wind speed, wind direction, fan power, and terrain data. Specifically, for the missing and outlier data of the wind speed and wind direction of the wind farm, linear interpolation is used for filling. For the missing and outlier data of the fan power, after linearly interpolating and filling the wind speed, it is estimated and filled by the fan power curve.
[0077] Step 2) Use the WRF Weather Research and Forecasting Model to predict and output the meteorological element data of the wind farm for the target location of the wind farm. The target location of the wind farm is the wind measurement tower of the wind farm. Use the Global Forecast System model output as the initial boundary condition and lateral boundary condition for the operation of the WRF Weather Research and Forecasting Model. The WRF Weather Research and Forecasting Model predicts and outputs the meteorological element data of the wind farm for the target location of the wind farm. The meteorological element data includes wind speed, wind direction, air pressure, temperature, and humidity.
[0078] Specifically, the WRF Weather Research and Forecasting Model uses three-layer nesting. As shown in Figure 2 , D01 has 121×121 grid points with a horizontal resolution of 3 km, and D02 and D03 have 1 km (109×109 grid points) and 333 m (91×91 grid points) respectively. Table 1 shows the detailed information of the physical parameterization scheme of the WRF Weather Research and Forecasting Model.
[0079] Table 1: Physical Options of the WRF Weather Research and Forecasting Model
[0080]
[0081] When the GFS (Global Numerical Weather Prediction Model) runs periodically, it is initialized at 12:00 UTC. For the 30-hour daily GFS forecast (all time zones below are provided in UTC format), the first 6 hours of the model startup time are discarded. The simulation time is from February 4th to March 4th, 2023, with a resolution of 15 minutes. Meteorological elements are extracted from the innermost region of WRF, including 16 parameters: sea-level pressure (PRES), total radiation (RAD), precipitation every 15 minutes (PRE_15), surface pressure (PRS), pressure at 70 m (P_70), relative humidity at 70 m and 2 m (RH_70, RH_2), temperature at 70 m and 2 m (T_70, T_2), dew point temperature at 2 m (D_2), wind direction and speed at 10 m (WD_10, WS_10), and zonal and meridional winds at 70 m (U_70, V_70), wind speed (WS_70), and wind direction (WD_70).
[0082] Step 3) According to the terrain data of the target location of the wind farm, the position information of the meteorological tower and each wind turbine, establish a CFD micro-scale terrain model of the target location of the wind farm, and conduct CFD wind field simulations for 16 wind directions. At the same time, establish a database from the wind speed and wind direction of the meteorological tower to the power of each wind turbine in combination with the power curves of each wind turbine; specifically, the simulation input of the CFD micro-scale terrain model is the wind profile of Class B terrain (the wind shear coefficient obtained by fitting the wind speeds at different heights of historical measured meteorological towers and wind turbines is 0.15), adopt the Realizable k-ε turbulence model, the inlet wind speeds at the hub height of the wind turbines are set to 3 m / s, 5 m / s, 7 m / s, 9 m / s, 11 m / s, 15 m / s and 19 m / s respectively, the wind direction is divided into 16 intervals, each interval is 22.5 degrees, namely 0 - 22.5°, 22.5 - 45°, 45 - 67.5°, 67.5 - 90°, 90 - 112.5°, 112.5 - 135°, 135 - 157.5°, 157.5 - 180°, 202.5 - 225°, 225 - 247.5°, 247.5 - 270°, 270 - 292.5°, 292.5 - 315°, 315 - 337.5°, 337.5 - 360°, a total of 112 simulation conditions are created; the simulation output of the CFD micro-scale terrain model includes the wind speed of the meteorological tower, the wind direction of the meteorological tower and the wind speed at the hub height of each wind turbine, and calculate the power of each wind turbine using the power curve of the wind turbine.
[0083] Specifically, the CFD simulation results include the wind speed and wind direction information at 70 m of the meteorological tower, and the wind speeds at the hub height of 13 wind turbines in the wind farm. Calculate the power generation power of 13 wind turbines using the factory power curve of the wind turbines. After obtaining the correlation between the wind speed at the position of the meteorological tower and the power generation power of the wind turbines under different wind directions, establish a database of wind speed at 70 m of the meteorological tower - wind direction at 70 m of the meteorological tower - power generation power of the wind turbines. In this database, the step sizes of the wind speed and wind direction of the meteorological tower are 0.1 and 1 respectively, and the data is obtained by linear interpolation.
[0084] Step 4) Establish an RF-VMD-PCA model (RVP), and use the RF-VMD-PCA model to perform feature preprocessing on the 16 meteorological element data predicted in Step 2).
[0085] Step 4.1) Use the Random Forest (RF) algorithm to screen out the meteorological element data closely related to the historical measured wind speed from the meteorological element data predicted by the WRF Weather Research and Forecasting Model as the input meteorological element data.
[0086] Step 4.1.1) Randomly extract subsets from the original meteorological element data through the bootstrapping method, and create decision trees based on these subsets to construct a random forest model.
[0087] Step 4.1.2) When constructing each decision tree, resample the meteorological element data to train the decision tree, and leave a set number of meteorological element data as out-of-bag data OOB. For each decision tree, calculate the out-of-bag error rate ERR of the model OOB1 to evaluate the performance of the decision tree;
[0088] Step 4.1.3) Randomly add noise interference to the meteorological element data X in the out-of-bag data OOB, and then recalculate the out-of-bag error rate ERR OOB2 ;
[0089] Step 4.1.4) Assume there are N trees in the random forest, then the importance imp of each meteorological element data X X is expressed by the following formula:
[0090] imp X = ∑(ERr OOB2 - ERR OOB1 ) / N;
[0091] Step 4.1.5) Select the meteorological element data with an importance imp X greater than 1.5% as the input meteorological element data.
[0092] Step 4.2) Use the variational mode decomposition (VMD) algorithm to decompose the wind speed error in the input meteorological element data to obtain the prediction error subsequence;
[0093] Step 4.2.1) Utilize the VMD constrained variational model to adaptively determine the relevant frequency scales and estimate the corresponding mode functions by establishing and solving a variational problem. The VMD constrained variational model is as follows:
[0094]
[0095] In the formula: k is the total number of decomposed modes, f is the original signal, u k = {u1, u2, …, u k} are the mode functions, ω k = {ω1, ω2, …, ω k} are the central frequencies of each mode, is the partial derivative with respect to time t, δ(t) is the Dirac δ function, usually taking the value of 1 at time 0 and 0 at other times, j is the imaginary unit, t is time; u k (t) is the variation of the k-th mode function with time t, and s is the constraint condition;
[0096] Aiming to convert the constrained problem into an unconstrained variational problem, an augmented Lagrangian function is introduced to solve the constrained optimization problem, as shown below:
[0097]
[0098] where: α is the penalty parameter, λ is the Lagrange multiplier, f(t) is the original signal, and λ(t) is the Lagrange multiplier used to introduce the constraint condition;
[0099] Step 4.2.2) Update the mode function u using the alternating direction method of multipliers k , the central frequency ω k and the Lagrange multiplier λ:
[0100]
[0101] where: τ is the noise tolerance rate, ω is the frequency, is the estimation of the k-th mode function for the frequency ω in the (n + 1)-th iteration, f(ω) is the frequency domain of the original signal, is the estimation of the i-th mode function for the frequency ω in the (n + 1)-th iteration, is the estimation of the Lagrange multiplier for the frequency ω in the n-th iteration, is the update of the central frequency of the k-th mode function in the (n + 1)-th iteration, is the frequency domain of the original signal;
[0102] Step 4.2.3) Repeat Step 4.2.2) until the accuracy of the mode function u k , the central frequency ω k and the Lagrange multiplier λ meets the set conditions and then stop the update to achieve the decomposition of the wind speed and wind direction errors predicted by the variational mode decomposition algorithm for the WRF weather research and forecasting model;
[0103]
[0104] where: ε is the tolerance of the convergence criterion;
[0105] Step 4.2.4) Decompose to obtain 12 predicted error subsequences, which are used as subsequent input features.
[0106] Step 4.3) Use the principal component analysis method (PCA) to extract the principal components of the predicted error subsequences, enrich the features of the prediction sequence, and complete the preprocessing of the features of the meteorological element data.
[0107] Step 4.3.1) Center all samples, that is, subtract the mean of the sample set from each sample x (i) .
[0108] Step 4.3.2) Calculate the covariance matrix XX T ;
[0109] Step 4.3.3) Perform eigenvalue decomposition on the covariance matrix XX T ;
[0110] Step 4.3.4) Determine the number of principal components n' after dimensionality reduction. By setting a proportion threshold t ∈ (0, 1], determine the number of principal components according to the proportion of eigenvalues. For example, if the n eigenvalues are λ1 ≥ λ2 ≥ … ≥ λ n , then n' is determined in the following way:
[0111]
[0112] Step 4.3.5) Obtain the eigenvectors (w1, w2, …, w n′ ) corresponding to the n' eigenvalues, and standardize them to form the eigenvector matrix W;
[0113] Step 4.3.6) For each sample x (i) in the sample set, perform the following transformation:
[0114] z (i) = W t x (i)
[0115] to obtain the sample set D' = (z (1) , z (2) , …, z (m) );
[0116] where: W T is the transpose of the eigenvector matrix W;
[0117] Step 4.3.7) Take the first 5 principal components of the error subsequences from the sample set D' after dimensionality reduction as the input features for the subsequent error correction model.
[0118] Step 5) Establish a TCN-SENet-BiLSTM-GAM error correction model based on the attention mechanism architecture, as shown in Appendix Figure 3 . Use the meteorological element data after feature preprocessing in Step 4) as the input of the error correction model to correct the predicted meteorological element data in Step 2).
[0119] Step 5.1) Use a series of temporal convolutional layers of the Temporal Convolutional Network (TCN) to capture sequential patterns at different time scales, and introduce the Channel Attention Mechanism (SENet) module into the output of the TCN to adaptively adjust the weights of channel features, which helps to extract spatial features related to the prediction target in the multi-feature sequence;
[0120] Step 5.2) Simultaneously perform forward and backward modeling on the sequence through a bidirectional long short-term memory network (BiLSTM) to capture the dependencies in the sequence. Meanwhile, apply the global attention mechanism (GAM) to weight the output of the BiLSTM, enabling the model to focus on the most important parts of the sequence, improving the model's perception ability of the time-domain features of the multi-feature sequence, and extracting the global time-domain features related to the prediction target in the multi-feature sequence;
[0121] Step 5.3) Stack and fuse the spatial features and global time-domain features extracted in Step 5.1) and Step 5.2). Subsequently, these fused features are fed into a fully connected layer for processing, thereby completing the construction of the TCN-SENet-BiLSTM-GAM error correction model to achieve a more accurate model prediction effect;
[0122] Step 5.4) Use all the features after feature preprocessing in Step 4) as the input of the TCN-SENet-BiLSTM-GAM error correction model to obtain the WRF error subsequences after VMD decomposition, sum them up to obtain the prediction error of the WRF Weather Research and Forecasting Model, and combine it with the prediction data of the WRF Weather Research and Forecasting Model to inversely correct the prediction error of the WRF Weather Research and Forecasting Model.
[0123] Step 6) Use the wind speed of the anemometer tower corrected in Step 5) and the wind direction data predicted by WRF, and combine with the CFD database obtained in Step 3) to predict the wind farm power;
[0124] Step 7) Evaluate the performance of the predicted results of the corrected anemometer tower wind speed and wind farm power.
[0125] In Step 7), use the root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) as performance evaluation indicators to evaluate the corrected results of the anemometer tower wind speed error and the wind farm power prediction results. The calculation formulas of these indicators are as follows:
[0126]
[0127] Where: N represents the number of samples, y i represents the true value at the i-th moment, represents the predicted value at the i-th moment.
[0128] Tables 2 and 3 respectively show the performance comparison results of different models for wind speed and power prediction. Compared with directly using the WRF model output, the proposed wind speed correction model performs excellently in wind speed prediction and power prediction. For example, during the test period, the RVP-TCN-SENet-BiLSTM-GAM model has better wind speed prediction performance than the WRF model, with its root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) being 0.91 m / s, 0.74 m / s, and 14.18% respectively, which are reduced by 0.61 m / s, 0.48 m / s, and 8.24% compared with the WRF model; the RVP-TCN-SENet-BiLSTM-GAM-CFD model also performs excellently in power prediction, with its root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) being 6.64 MW, 5.19 MW, and 55.17% respectively, which are reduced by 4.29 MW, 3.51 MW, and 25.47% compared with the WRF model. This indicates that the proposed wind speed correction and mesoscale WRF-CFD coupling strategy significantly improves the wind farm power prediction accuracy.
[0129] Table 2: Performance Comparison Results of Different Models for Wind Speed Prediction
[0130]
[0131]
[0132] Table 3: Performance Comparison Results of Different Models for Power Prediction
[0133]
[0134] This embodiment aims to improve the accuracy of wind power prediction. By introducing the meso-microscale WRF-CFD coupling method to simulate the microscale wind field and correct the error of the original WRF predicted wind speed. First, use the Weather Research and Forecasting (WRF) model to obtain the meteorological data at the location of the wind measurement tower and conduct a statistical analysis of the wind speed prediction accuracy. Subsequently, introduce the RF-VMD-PCA (RVP) model to preprocess the features of the meteorological data. Then, establish a TCN-SENet-BiLSTM-GAM error correction model with an attention mechanism architecture to correct the error of the original WRF predicted wind speed. Finally, use the CFD model to conduct a microscale simulation of the wind farm in the study area and establish a database from the wind speed and direction at the wind measurement tower location to the wind turbine power. The corrected WRF wind speed is used as the database input for power prediction of the entire wind farm. The experimental results show that this error correction algorithm significantly improves the wind speed prediction accuracy, and after correction, the accuracy of the very short-term wind power prediction also significantly improves. At the same time, the meso-microscale WRF-CFD coupling method also significantly improves the power prediction accuracy.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Those of ordinary skill in the art should understand that any modifications or equivalent replacements made to the technical solutions of the present invention without departing from the purpose and scope of the present technical solution shall be covered by the scope of the claims of the present invention.
Claims
1. A wind power prediction method based on WRF-CFD simulation and attention mechanism architecture model, characterized in that It includes the following steps: Step 1) Collect the information of the wind farm, where the information of the wind farm includes wind speed, wind direction, fan power, and terrain data; Step 2) Use the WRF Weather Research and Forecasting Model to predict and output the meteorological element data of the wind farm for the target location of the wind farm; Step 3) According to the terrain data of the target location of the wind farm, the positions of the wind measurement towers and each fan, establish a CFD micro-scale terrain model of the target location of the wind farm, and conduct CFD wind field simulations for 16 wind directions. At the same time, establish a database from the wind speed and wind direction of the wind measurement tower to the power of each fan in combination with the power curve of each fan; Step 4) Establish an RF-VMD-PCA model, and use the RF-VMD-PCA model to perform feature preprocessing on the predicted meteorological element data in Step 2); Step 4) includes the following steps: Step 4.1) Use the random forest algorithm to screen out the meteorological element data closely related to the historical measured wind speed from the meteorological element data predicted by the WRF Weather Research and Forecasting Model as the input meteorological element data; Step 4.2) Use the variational mode decomposition algorithm to decompose the wind speed error in the input meteorological element data to obtain the prediction error subsequences; Step 4.2) includes the following steps: Step 4.2.1) Utilize the VMD constrained variational model to adaptively determine the relevant frequency scales and estimate the corresponding mode functions by establishing and solving the variational problem. The VMD constrained variational model is as follows: where: k is the total number of decomposed modes, f is the original signal, and u k = {u1, u2, …, u k} are the mode functions, ω k = {ω1, ω2, …, ω k} are the central frequencies of each mode, is the partial derivative with respect to time t, δ(t) is the Dirac delta function, which usually takes the value of 1 at time 0 and 0 at other times, j is the imaginary unit, and t is time; u k (t) is the variation of the k-th mode function with respect to time t, and s is the constraint condition; The augmented Lagrangian function is introduced for constrained optimization: In the formula: α is the penalty parameter, λ is the Lagrange multiplier, f(t) is the original signal, and λ(t) is the Lagrange multiplier used to introduce the constraint condition; Step 4.2.2) Update the modal function u, the central frequency ω k and the Lagrange multiplier λ using the alternating direction method of multipliers: k , the central frequency ω k and the Lagrange multiplier λ: Where: τ is the noise tolerance rate, ω is the frequency, is the estimation of the k-th mode function for the frequency ω in the (n + 1)-th iteration, f(ω) is the frequency domain of the original signal, is the estimation of the i-th mode function for the frequency ω in the (n + 1)-th iteration, is the estimation of the Lagrange multiplier for the frequency ω in the n-th iteration, is the update of the central frequency of the k-th mode function in the (n + 1)-th iteration, is the signal component in the frequency domain of the original signal; Step 4.2.3) Repeat Step 4.2.2) until the accuracies of the mode function u k , the central frequency ω k and the Lagrange multiplier λ meet the set conditions and stop the update, so as to realize the decomposition of the variational mode decomposition algorithm for the wind speed error predicted by the WRF weather research and forecasting model; In the formula: ε is the tolerance of the convergence criterion; Step 4.2.4) Decompose to obtain 12 prediction error subsequences; Step 4.3) Use the principal component analysis method to extract the principal components of the prediction error subsequences, enrich the features of the prediction sequence, and complete the feature preprocessing of the meteorological element data; Step 5) Establish an error correction model based on the attention mechanism architecture, and use the meteorological element data after feature preprocessing in Step 4) as the input of the error correction model to correct the predicted meteorological element data in Step 2); Step 6) Use the wind speed of the wind measurement tower corrected in Step 5) and the wind direction data predicted by the WRF model, and combine the CFD database obtained in Step 3) to predict the power of the wind farm; Step 7) Evaluate the performance of the corrected wind speed of the wind measurement tower and the prediction results of the wind farm power.
2. The wind power prediction method based on the WRF-CFD simulation and the attention mechanism architecture model according to claim 1, wherein, In Step 1), for the missing and outlier data of the wind speed and wind direction of the wind farm, linear interpolation is used for filling; For the missing and outlier data of the fan power, after linearly interpolating and filling the wind speed, it is then estimated and filled by the fan power curve.
3. The wind power prediction method based on the WRF-CFD simulation and attention mechanism architecture model according to claim 1, wherein In step 2), the target location of the wind farm is the anemometer tower of the wind farm. The output of the Global Forecast System model is used as the initial boundary condition and lateral boundary condition for the operation of the WRF Weather Research and Forecasting model. The WRF Weather Research and Forecasting model predicts and outputs the meteorological element data of the wind farm for the target location of the wind farm. The meteorological element data includes wind speed, wind direction, air pressure, temperature, and humidity.
4. The wind power prediction method based on the WRF-CFD simulation and attention mechanism architecture model according to claim 1, characterized in that In step 3), the simulation input of the CFD micro-scale terrain model is the wind profile of type B terrain. The Realizable k-ε turbulence model is adopted. The inlet wind speeds at the hub height of the wind turbines are set to 3 m / s, 5 m / s, 7 m / s, 9 m / s, 11 m / s, 15 m / s, and 19 m / s respectively. The wind direction is divided into 16 intervals, each interval being 22.5 degrees, and a total of 112 simulation conditions are created. The simulation output of the CFD micro-scale terrain model includes the wind speed of the anemometer tower, the wind direction of the anemometer tower, and the wind speeds at the hub heights of each wind turbine, and the power of each wind turbine is calculated using the wind turbine power curve.
5. The wind power prediction method based on the WRF-CFD simulation and the attention mechanism architecture model according to claim 1, characterized in that Step 4.1) includes the following steps: Step 4.1.1) Randomly extract subsets from the original meteorological element data by the bootstrap method, and create decision trees based on these subsets to construct a random forest model; Step 4.1.2) When constructing each decision tree, resample the meteorological element data to train the decision tree, and leave a set number of meteorological element data as out-of-bag data OOB. For each decision tree, calculate the out-of-bag error rate ERR of the random forest model oOB1 to evaluate the performance of the decision tree; Step 4.1.3) Randomly add noise interference to the meteorological element data X in the out-of-bag data OOB, and then recalculate the out-of-bag error rate ERR OOB2 ; Step 4.1.4) Suppose there are N trees in the random forest, then the importance imp of each meteorological element data X X is expressed by the following formula: imp X = ∑(ERR OOB2 - ERR OOB1 ) / N; Step 4.1.5) Select the importance imp X Meteorological element data greater than 1.5% are used as the input meteorological element data.
6. The wind power prediction method based on the WRF-CFD simulation and the attention mechanism architecture model according to claim 1, characterized in that Step 4.3) includes the following steps: Step 4.3.1) Centralize all samples, that is, subtract the mean of the sample set from each sample x (i) ; Step 4.3.2) Calculate the covariance matrix XX of the samples T ; Step 4.3.3) Perform eigenvalue decomposition on the covariance matrix XX T ; Step 4.3.4) Determine the number of principal components \(n'\) after dimensionality reduction. By setting a proportion threshold \(t\in(0,1]\), determine the number of principal components according to the proportion of eigenvalues. For example, if the \(n\) eigenvalues are \(\lambda_1\geq\lambda_2\geq\cdots\geq\lambda\) n , then \(n'\) is determined in the following way: Step 4.3.5) Obtain the eigenvectors (w1, w2, …, w n′ ) corresponding to the n′ eigenvalues, and normalize them to form the eigenvector matrix W; Step 4.3.6) For each sample x in the sample set (i) , perform the following transformation: z (i) = W T x (i) Obtain the sample set D' = (z (1) , z (2) , …, z (m) ); Where: W T is the transpose of the eigenvector matrix W; Step 4.3.7) Take the first 5 principal components of the error subsequences from the dimension-reduced sample set D′ as the input features of the subsequent error correction model.
7. The wind power prediction method based on the WRF-CFD simulation and the attention mechanism architecture model according to claim 1, wherein In step 5), a TCN-SENet-BiLSTM-GAM error correction model based on the attention mechanism architecture is established, which specifically includes the following steps: Step 5.1) Use a series of temporal convolutional layers of the Temporal Convolutional Network (TCN) to capture sequence patterns at different time scales, and introduce the Squeeze-and-Excitation Network (SENet) module into the output of the Temporal Convolutional Network (TCN) to adaptively adjust the weights of channel features, which helps to extract spatial features related to the prediction target in the multi-feature sequence; Step 5.2) Simultaneously perform forward and backward modeling on the sequence through the Bidirectional Long Short-Term Memory (BiLSTM) network to capture the dependencies in the sequence. At the same time, apply the Global Attention Mechanism (GAM) to weight the output of the Bidirectional Long Short-Term Memory (BiLSTM) network to extract the global time-domain features related to the prediction target in the multi-feature sequence; Step 5.3) Stack and fuse the spatial features and global time-domain features extracted in step 5.1) and step 5.2). Subsequently, these fused features are fed into the fully connected layer for processing, thus completing the construction of the TCN-SENet-BiLSTM-GAM error correction model; Step 5.4) Use all the features after feature preprocessing in step 4) as the input of the TCN-SENet-BiLSTM-GAM error correction model to obtain the WRF error subsequences after variational mode decomposition, sum them to obtain the prediction error of the WRF Weather Research and Forecasting model, and combine it with the prediction data of the WRF Weather Research and Forecasting model to inversely correct the prediction error of the WRF Weather Research and Forecasting model.
8. The wind power prediction method based on the WRF-CFD simulation and attention mechanism architecture model according to claim 1, characterized in that, In step 7), the root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) are used as performance evaluation indicators to evaluate the error-corrected results of the wind speed at the wind measurement tower and the wind farm power prediction results. The calculation formulas for these indicators are as follows: Where: N represents the number of samples, y i represents the true value at the i-th moment, represents the predicted value at the i-th moment.