Background
The Markov Chain Monte Carlo (MCMC) method is a simple and practical wind power output time sequence random generation method. The wind power output random variable generated by the method can meet the requirement of transition Probability between different defined states, and meanwhile, the MCMC method can enable the generated wind power output time sequence to keep the mean value, standard deviation, Probability Density Function (PDF) and Autocorrelation Coefficient (ACF) of original data, so that the method has high practical value.
However, the MCMC method can only be used to generate discrete state points, and the wind power values in each state are arbitrary, and are generally superimposed by uniformly distributed random numbers. The MCMC method is adopted to generate the wind power time sequence, the characteristics of the generated wind power output time sequence are closely related to the selection of the state number, the state number is determined mainly by experience at present, a corresponding theoretical basis is lacked, and how to determine the optimal state number of the generated sequence is an important problem to be solved urgently.
Therefore, in order to solve the above problems, it is necessary to provide a method and a system for determining an optimal state number for wind power modeling, so as to improve the modeling accuracy of the MCMC method.
Disclosure of Invention
The invention provides a method for determining an optimal state number of wind power modeling, which comprises the following steps:
collecting and sorting historical wind power output data, setting different output state numbers, and dividing states of wind power;
establishing a state transition matrix among wind power output data points under different output state numbers;
generating wind power output time sequences under different state numbers according to the state transition matrix;
calculating the autocorrelation coefficient of the historical wind power output time sequence lag at the k moment and the autocorrelation coefficient of the generated wind power output time sequence lag at the k moment;
calculating the mean square error of the autocorrelation coefficient of the historical wind power output time sequence lag at the k moment and the autocorrelation coefficient of the generated wind power output time sequence lag at the k moment;
and selecting the state number when the mean square error of the autocorrelation coefficients is the minimum value as the optimal state number.
The historical wind power output data is sorted as follows: the historical wind power output data is subjected to normalization processing;
the state of dividing the wind power according to the output state number is as follows: setting the state number as N, discretizing the normalized wind power output value range, dividing discrete intervals according to the state number, wherein each discrete interval represents one state of wind power, and the discretization interval in which the normalized wind power output falls represents the state of the normalized wind power output.
Establishing NxN state transitions based on different numbers of states NMatrix, element P of said state transition matrixijAs shown in the following formula:
pij=Pr(xn=j|xn-1=i) (3)
wherein, PijThe probability, x, of the wind power output shifting from the current state i to the next state jnAnd xn-1Respectively representing the states at times n and n-1.
Respectively calculating the autocorrelation coefficient of the historical wind power output time sequence lag at the k moment and the generated autocorrelation coefficient of the wind power output time sequence lag at the k moment according to the formula (4);
wherein p is
tIs the power value at time t, p
t+kThe power value at the time t + k,
mean square error P of the autocorrelation coefficienttlComprises the following steps:
wherein,
is the autocorrelation coefficient of the wind power output time sequence generated when the variable lag time i,
the self-correlation coefficient is the self-correlation coefficient of the historical wind power output time sequence when the variable lag time i.
And the collected and sorted historical wind power output data is the wind power output historical data of the wind power station with the time length of 1 year and the time resolution of 15 min.
The invention provides a system for determining the optimal state number of wind power modeling, which comprises:
the state dividing module is used for dividing the historical wind power output data into output states with different numbers;
the transfer matrix module is used for calculating a state transfer matrix among the wind power output data points under different output state numbers;
the sequence generation module is used for randomly sampling according to the state transition matrix to generate wind power output time sequences under the condition of different output state numbers;
the autocorrelation coefficient module is used for calculating the autocorrelation coefficient of the historical wind power output time sequence lag at the k moment and the generated autocorrelation coefficient of the wind power output time sequence lag at the k moment;
a mean square error module: the wind power generation system is used for calculating the mean square error of the autocorrelation coefficient of the historical wind power output time sequence and the autocorrelation coefficient of the generated wind power output time sequence;
a state number determination module: and selecting the state number when the mean square error of the autocorrelation coefficients is the minimum value as the optimal state number.
The state division module: the method comprises the steps of carrying out normalization processing on historical wind power output data, discretizing a normalized wind power output value range to obtain N discretization intervals, wherein one discretization interval represents one state of wind power, and the interval in which the normalized wind power output falls represents the state of the normalized wind power output.
Compared with the closest prior art, the technical scheme provided by the invention has the following beneficial effects:
according to the technical scheme provided by the invention, the accuracy of generating the wind power output time sequence by the MCMC method is improved to the maximum extent by selecting the optimal state number for wind power modeling, and theoretical reference is provided for the selection of the optimal state number of the wind power by the MCMC method.
Detailed Description
The invention is described in further detail below with reference to the accompanying drawings:
as shown in fig. 1, the invention provides a method for determining an optimal number of states for wind power modeling, which comprises the following steps:
collecting and sorting historical wind power output data, setting different output state numbers, and dividing states of wind power;
establishing a state transition matrix among wind power output data points under different output state numbers;
generating wind power output time sequences under different state numbers according to the state transition matrix;
calculating the autocorrelation coefficient of the historical wind power output time sequence lag at the k moment and the autocorrelation coefficient of the generated wind power output time sequence lag at the k moment;
calculating the mean square error of the autocorrelation coefficient of the historical wind power output time sequence lag at the k moment and the autocorrelation coefficient of the generated wind power output time sequence lag at the k moment;
and selecting the state number when the mean square error of the autocorrelation coefficients is the minimum value as the optimal state number.
As shown in FIG. 2, the method firstly collects and arranges historical wind power output data for normalization processing, divides the historical wind power output data into output states with different numbers, respectively calculates state transition frequency numbers and state transition probability matrixes among wind power output data points under the output states with different numbers, utilizes the state transition probability matrixes to carry out random sampling to generate wind power sequences, and adopts the mean square error of autocorrelation coefficients to select the optimal state of sequence modeling. And a theoretical basis is laid for the deep research of wind power output time series modeling.
The invention comprises the following steps:
collecting and sorting wind power output historical data of the wind power station with the time length of 1 year and the time resolution of 15 min;
carrying out normalization processing, and calculating the proportion of the historical wind power output time sequence of the wind power station and the data value of the installed capacity of the wind power at the corresponding moment to obtain normalized historical wind power output, wherein the calculation method is as shown in formula (1):
wherein P issIs a normalized value, PtFor historical force giving, PinstallIs installed capacity;
defining different output states of wind power output, discretizing the normalized historical wind power output value range, wherein each discretization interval represents one state of wind power, the number of the states is N, and if P is P, the number of the states is NsWhen formula (2) is satisfied, P issBelongs to the state i
Wherein i is 1, 2.
Calculating a state transition matrix P under the condition of different state numbers N, wherein the state transition matrix P is an N multiplied by N matrix, and each element P in PijThe value of (b) represents the probability that the current moment of the wind power output is in the state i and the current moment is transferred to the state j. Can be calculated by the equation (3),
pij=Pr(xn=j|xn-1=i) (3)
wherein xnAnd xn-1Respectively representing the states at times n and n-1.
Wind power output time sequences under different state numbers N are generated according to the state transition matrix P, and the Autocorrelation Coefficient (ACF) of the historical sequence lagging k time and the Autocorrelation Coefficient (ACF) of the generated sequence lagging k time are respectively calculated by adopting an equation (4), wherein k is generally 100.
Wherein p is
tIs the power value at time t, p
t+kThe power value at the time t + k,
k is the time interval.
Calculating the mean square error P of the autocorrelation coefficients of the original sequence and the generated sequence within lag time k by adopting the formula (5)tl
Wherein,
the autocorrelation coefficients of the sequence are generated for a variable lag time i,
is the autocorrelation coefficient of the history sequence at the lag time i of the variable, and k is the time interval.
And (4) selecting the state number N when the mean square error of the autocorrelation coefficients is the minimum value according to the formula (6), namely the optimal state number.
Based on the same inventive concept, the embodiment of the invention also provides a system for determining the optimal state number of the wind power modeling, which is explained below.
The system may include:
the state dividing module is used for dividing the historical wind power output data into output states with different numbers;
the transfer matrix module is used for calculating a state transfer matrix among the wind power output data points under different output state numbers;
the sequence generation module is used for randomly sampling according to the state transition matrix to generate wind power output time sequences under the condition of different output state numbers;
the autocorrelation coefficient module is used for calculating the autocorrelation coefficient of the historical wind power output time sequence lag at the k moment and the generated autocorrelation coefficient of the wind power output time sequence lag at the k moment;
a mean square error module: the wind power generation system is used for calculating the mean square error of the autocorrelation coefficient of the historical wind power output time sequence and the autocorrelation coefficient of the generated wind power output time sequence;
a state number determination module: and selecting the state number when the mean square error of the autocorrelation coefficients is the minimum value as the optimal state number.
The state division module: the method comprises the steps of carrying out normalization processing on historical wind power output data, discretizing a normalized wind power output value range to obtain N discretization intervals, wherein one discretization interval represents one state of wind power, and the interval in which the normalized wind power output falls represents the state of the normalized wind power output.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting the scope of protection thereof, and although the present application is described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: numerous variations, modifications, and equivalents will occur to those skilled in the art upon reading the present application and are within the scope of the claims appended hereto.