Summary of the invention
The present invention solves the existing technical matters of prior art; Provide the relation of a kind of direct consideration and relevant historical data or numerical weather prediction data and power stage, the simple a kind of wind power forecasting method of modeling method and device thereof.
It is to solve the existing technical matters of prior art that the present invention also has a purpose; A kind of strong adaptability is provided, has can be used as a kind of wind power forecasting method and the device thereof of the power prediction model of general wind energy turbine set.
It is the technical matters that solves the existing grade of prior art that the present invention has a purpose again; A kind of fast computational speed is provided, and cost is low, a kind of wind power forecasting method and the device thereof easily promoted.
Above-mentioned technical matters of the present invention is mainly solved by following technical proposals:
A kind of wind power forecasting method is characterized in that, may further comprise the steps:
Step 1, data extraction module are carried out the data extraction from numerical weather forecast system or the relevant SCADA of electric system, the data after carrying are carried out pre-service; And determine the input and output of least square method supporting vector machine training sample according to the data after processing;
Step 2, data initialization module are to the parameter of initialization least square method supporting vector machine in the step 1 and improved self-adaptation particle cluster algorithm;
Step 3, optimize module take regression error quadratic sum minimum as fitness, use improve the self-adaptation particle cluster algorithm based on initialization in the step 2 after parameter the Parameters in Regression Model of least square method supporting vector machine is optimized;
Step 4, model building module obtain the model of least square method supporting vector machine according to the parameter after optimizing in the step 3;
Step 5, prediction module are predicted according to the model of the least square method supporting vector machine that obtains in the step 4.
At above-mentioned a kind of wind power forecasting method, in the described step 1, in the described step 1, extract data and comprise wind speed, temperature and wind energy turbine set actual measurement output power data, described wind speed, temperature are as the input data of least square method supporting vector machine training sample; Described wind energy turbine set actual measurement output power is as the output data of least square method supporting vector machine training sample.
At above-mentioned a kind of wind power forecasting method, in the described step 2, after the input and output of having determined training least square method supporting vector machine model, the prerequisite of carrying out model optimization is the initialization of model parameter and optimized algorithm parameter, and initialization mainly contains following three steps:
Punishment parameter γ and the nuclear parameter σ of step 2.1, at first definite least square method supporting vector machine
2Scope;
The correlation parameter of step 2.2, secondly definite self-adaptation particle cluster algorithm;
Step 2.3, at punishment parameter γ and the nuclear parameter σ of least square method supporting vector machine
2Random initializtion population in the scope.
At above-mentioned a kind of wind power forecasting method, in the described step 3, behind parameter initialization, need to set the fitness of optimized algorithm, preference pattern regression error quadratic sum minimum is fitness, according to the training input and output data of selecting in the step 1, use the correlation parameter of improved self-adaptation particle cluster algorithm Optimized Least Square Support Vector, step is as follows:
Step 3.1, initialization population parameter;
Step 3.2, calculating adaptive weighting;
Step 3.3, take regression error quadratic sum minimum as fitness, calculate also relatively fitness value;
Step 3.4, renewal speed and position;
Step 3.5, judge end condition, satisfied then export optimum results, satisfied then repeating step 3.2 is to step 3.4.
At above-mentioned a kind of wind power forecasting method, in the described step 4, after using improved self-adaptation particle cluster algorithm to obtain the parameter of least square method supporting vector machine, solve the most lower two parameter alpha of taking advantage of in the support vector machine regression model according to least square method supporting vector machine algorithm and training sample
iAnd b, then will find the solution the parameter that obtains and bring in the regression function formula (7), thereby construct the least square method supporting vector machine model of wind power prediction.
At above-mentioned a kind of wind power forecasting method, in the described step 5, selected correlated inputs is determined the input of prediction during according to training pattern, uses the model after optimizing to obtain predicting the outcome of wind power.
At above-mentioned a kind of wind power forecasting method, in the described step 2.1, the least square method supporting vector machine model is based on following method:
A given training data point set (x
i, y
i), i=1 ..., l, x
i∈ R
dBe and the closely-related influence factor of premeasuring, d is the dimension of selected input variable, i output y
i∈ R is the measured value of premeasuring, and l is the sum of given data point set; The target of supporting vector machine model is regression function suc as formula a form of structure:
Formula one
So that functional value y corresponding to sample input data x can be similar to Nonlinear Mapping by enough f (x)
To input in data-mapping to a high-dimensional feature space, and press structural risk minimization, the optimization aim of least square method supporting vector machine is expressed as:
Formula two
In the formula: ω is weight vector; B is side-play amount; e
iBe error variance; E ∈ R
L * 1Be error vector; γ is regularization parameter, and control is to the punishment degree of error;
Definition Lagrange multiplier α
i, α
i∈ R
L * 1, then the Lagrange polynomial expression of its dual problem is:
Formula three
Can be got by the Karush-Kuhn-Tucker condition:
Formula four is write as following system of linear equations:
Formula five
In the formula five:
E=[e
1, e
2..., e
l], y=[y
1, y
2..., y
l]
T, α=[α
1, α
2..., α
l]
T
W in the subtractive five and e make five of formulas relevant with b, α, and like this, formula five is converted into following system of equations:
Formula six
In the formula: A=ZZ
T+ γ
-1I, ZZ
TBe the square formation of a l * l, the element of the capable n row of m is
Because A is a symmetrical positive semidefinite matrix, in the hope of the solution of b and α, the solution of b and α is brought in the formula one, obtain the expression formula of regression model:
Formula seven
In the formula: K (x
i, the x) Nonlinear Mapping of expression from the input space to the high-dimensional feature space, namely the kernel function of LSSVM selects different kernel functions can form different algorithms; Studies show that effect is preferably the radial basis kernel function in regression forecasting:
Formula eight
In the formula: σ is the nuclear width, || x-x
k‖ is two norms;
In the regression model of least square method supporting vector machine, punishment parameter γ and nuclear parameter σ
2Be two parameters that affect least square method supporting vector machine performance maximum, the present invention uses improved self-adaptation particle cluster algorithm to carry out the optimization of parameter;
In the described step 2.2, described self-adaptation particle cluster algorithm is described as: speed and the position of supposing i particulate in d dimension search volume are expressed as respectively V
i=v
I1v
I2..., v
Id), X
i=(x
I1, x
I2..., x
Id); By estimating the objective function of each particulate, determine t constantly each particulate optimum position (pbest) P of process
i=(pbest
1, pbest
I2, pbest
Id) and optimal location (gbest) P that finds of colony
g=(gbest
I1, gbest
I2, gbest
Id), upgrade respectively again speed and the position of each particulate by following formula:
v
I, j(t+1)=wv
I, j(t)+c1rand ((p
I, j-x
Ij(t))+c
2Rand ((P
G, i-x
I, j(t)) formula nine
x
I, j(t+1)=x
I, j(t)+v
I, j(t+1), j=1 ..., d formula ten
In the formula, w is the Inertia Weight coefficient, is used for the front face velocity of control to the impact of present speed; C1 and c2 are speedup factors, and rand is the random number between 0 to 1, in addition, and by the speed interval v of particulate is set
Min, v
Max] and position range [x
Min, x
Max], then can move particulate and carry out suitable restriction;
The selection of Inertia Weight coefficient w directly affects the convergence of algorithm performance, and larger w has stronger global convergence ability, and less w then has a stronger local convergence ability; Therefore, the correct method of choosing inertia weight should be the increase along with iterations, and inertia weight should constantly reduce, thereby so that particle swarm optimization has stronger global convergence ability at the evolution initial stage, has stronger local convergence ability late period and evolve; Wherein the value of self-adaptation inertia weight w is shown below:
Formula 11
In the formula, the value of β is determined by experience, general β ∈ [15,20].T is current evolutionary generation, T
MaxBe maximum evolutionary generation.
A kind of device that adopts wind power forecasting method is characterized in that, comprises the data extraction module, data initialization module, optimization module, model building module and the prediction module that connect successively.
Therefore, the present invention has following advantage: 1. the relation of the direct consideration of the present invention and relevant historical data or numerical weather prediction data and power stage, and modeling method is simple; 2. strong adaptability can be used as the power prediction model of general wind energy turbine set; 3. owing to do not consider middle a lot of modeling links, only consider the relation between the input and output, comparatively speaking, fast computational speed; 4. cost is low, easily promotes.
Embodiment:
At first, introduce the theory basis that the present invention relates to.
1. least square method supporting vector machine regression forecasting principle.
A given training data point set (x
i, y
i), i=1 ..., l, x
i∈ R
dBe and the closely-related influence factor of premeasuring, d is the dimension of selected input variable, i output y
i∈ R is the measured value of premeasuring, and l is the sum of given data point set.The target of supporting vector machine model is regression function suc as formula (1) form of structure.
So that functional value y corresponding to sample input data x can be similar to Nonlinear Mapping by enough f (x)
To input in data-mapping to a high-dimensional feature space.Press structural risk minimization (structurerisk minimization, SRM) principle, the optimization aim of least square method supporting vector machine can be expressed as:
In the formula: ω is weight vector; B is side-play amount; e
iBe error variance; E ∈ R
L * 1Be error vector; γ is regularization parameter, and control is to the punishment degree of error.
Introduce Lagrange multiplier α
i, α
i∈ R
L * 1, then the Lagrange polynomial expression of its dual problem is:
By Karush-Kuhn-Tucker(KKT) condition can get
Formula (4) can be write as following system of linear equations:
In the formula (5):
E=[e
1, e
2..., e
l], y=[y
1, y
2..., y
l]
T, α=[α
1, α
2..., α
l]
T
W and e in the subtractive (5) make system of equations (5) only relevant with b, α, and like this, system of equations (5) just is converted into and can obtains following system of equations:
In the formula: A=ZZ
T+ γ
-1I, ZZ
TBe the square formation of a l * l, the element of the capable n row of m is
Because A is a symmetrical positive semidefinite matrix, so can try to achieve the solution of b and α, the solution of b and α is brought in the formula (1), obtain the expression formula of regression model:
In the formula: K (x
i, x) Nonlinear Mapping of expression from the input space to the high-dimensional feature space, the namely kernel function of LSSVM.Select different kernel functions can form different algorithms.Studies show that effect is preferably the radial basis kernel function in regression forecasting:
In the formula: σ is the nuclear width, || x-x
k‖ is two norms.
In the regression model of least square method supporting vector machine, punishment parameter γ and nuclear parameter σ
2Two parameters that affect least square method supporting vector machine performance maximum.The present invention uses improved self-adaptation particle cluster algorithm to carry out the optimization of parameter.
2. self-adaptation particle cluster algorithm and improvement.
Classical particle cluster algorithm can be described as: speed and the position of supposing i particulate in d dimension search volume are expressed as respectively V
i=v
I1, v
I2..., vi
D), X
i=(x
I1, x
I2..., x
Id).By estimating the objective function of each particulate, determine t constantly each particulate optimum position (pbest) P of process
i=(pbest
I1, pbest
I2, pbest
Id) and optimal location (gbest) P that finds of colony
g=(gbesti
1, gbest
I2, gbest
Id), upgrade respectively again speed and the position of each particulate by following formula:
v
i,j(t+1)=w·v
i,j(t)+c
1·rand·((p
i,j-x
i,j(t))+c
2·rand·((P
g,i-x
i,j(t)) (9)
x
i,j(t+1)=x
i,j(t)+v
i,j(t+1),j=1,…,d (10)
In the formula, w is the Inertia Weight coefficient, is used for the front face velocity of control to the impact of present speed; C1 and c2 are speedup factors, and rand is the random number between 0 to 1, in addition, and by the speed interval [v of particulate is set
Min, v
Max] and position range [x
Min, x
Max], then can move particulate and carry out suitable restriction.
The selection of Inertia Weight coefficient w directly affects the convergence of algorithm performance, and larger w has stronger global convergence ability, and less w then has a stronger local convergence ability.Therefore, the correct method of choosing inertia weight should be the increase along with iterations, and inertia weight should constantly reduce, thereby so that particle swarm optimization has stronger global convergence ability at the evolution initial stage, has stronger local convergence ability late period and evolve.So this paper uses the method for self-adaptation inertia weight that particle cluster algorithm is improved, wherein the value of self-adaptation inertia weight w is shown below:
In the formula, the value of β is determined by experience, general β ∈ [15,20].T is current evolutionary generation, T
MaxBe maximum evolutionary generation.
3. the general step of improved particle cluster algorithm Optimized Least Square Support Vector.
The step of improved particle swarm optimization least square method supporting vector machine is as follows:
1) initialization population parameter;
2) calculate adaptive weighting according to formula (11);
3) take regression error quadratic sum minimum as fitness, calculating is also compared fitness value;
4) according to formula (9), formula (10) renewal speed and position;
5) judge end condition, satisfied then export optimum results, satisfied then turning to step 2).
The below is the modeling process of specific embodiments of the invention.
Modeling overall flow figure of the present invention as shown in Figure 2.Concrete steps are as follows:
1) choose the training sample data line number Data preprocess of going forward side by side, data prediction comprised for two steps, the first step, the smoothing techniques of missing data, second step, the normalized of data.
Owing to subjective or objectively reason exist the situation of data exception or disappearance, for the predicated error that reduces of trying one's best, at first missing data is revised, this paper adopts straight line to look into reinforcing method.Namely for the data x that lacks
t, by formula (12) missing data is carried out the smoothing correction.
The x here
iAnd x
jBe respectively i, j actual measurement wind speed or temperature data constantly, x
tFor looking into the data of benefit, concern to revise according to trend.
After to the data smoothing techniques, need to carry out the normalization arrangement to data, data are carried out normalized, can reduce unhealthy data to the impact of prediction effect, accelerate training speed and the speed of convergence of model sample.The method for normalizing that this patent adopts is shown in formula (13):
In the formula: y
iA certain variable data x among the training sample T
iData after the normalization, x
MinBe the minimum value of reorganization variable data among the sample T, x
MaxFor organizing the maximal value of variable data among the sample T
After data are carried out pre-service, initialization least squares support vector machine and improvement particle cluster algorithm parameter;
2) take regression error quadratic sum minimum as fitness, use improvement self-adaptation particle cluster algorithm to be optimized according to the Parameters in Regression Model of the described Optimization Steps of upper joint to least square method supporting vector machine;
3) parameter after utilize optimizing and relevant training data obtain the regression model of least square method supporting vector machine;
4) the wind speed and direction data or historical wind speed, wind direction and the power data that provide according to the numerical weather forecast system use the training good model that wind power is predicted.
Specific embodiment described herein only is to the explanation for example of the present invention's spirit.Those skilled in the art can make various modifications or replenish or adopt similar mode to substitute described specific embodiment, but can't depart from spirit of the present invention or surmount the defined scope of appended claims.