A method for extracting reservoir optimization operation rules based on dynamic time-varying structure
By adopting a scheduling rule extraction method with a dynamic time-varying structure in reservoir scheduling, and dynamically selecting input factors and decision variables using random forest and gradient enhancement algorithms, the problem of insufficient scheduling rules in the existing technology is solved, and more efficient reservoir scheduling decisions are achieved.
Patent Information
- Application Number
- CN202111239728.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-25
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2041-10-25
AI Technical Summary
In the existing reservoir scheduling rules extraction method, the fixed scheduling function form fails to fully consider the optimal matching between input factors and decision variables at different time periods, resulting in insufficient accuracy of scheduling rules.
The reservoir optimization scheduling rule extraction method is adopted with a dynamic time-varying structure. By establishing a time-varying scheduling function form, combining random forests and gradient enhancement algorithms, dynamically selecting input factors and decision variables to optimize scheduling rules.
The accuracy of extraction of reservoir scheduling rules has been improved, the accuracy of scheduling decisions has been enhanced, and the benefits of reservoir scheduling have been maximized.
Smart Images

Figure CN113962463B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for extracting reservoir dispatching rules in the field of hydrology and water resources, and in particular to a method for extracting reservoir optimization dispatching rules with a dynamic time-varying structure. Background Art
[0002] Reservoir optimization dispatching rules are one of the effective tools to guide reservoir operation and dispatching. The quality of dispatching rules will directly affect the benefits of reservoir dispatching. In order to obtain reasonable and efficient reservoir dispatching rules, not only an effective rule extraction model is needed, but also a reasonable dispatching rule form is needed.
[0003] At present, the most commonly used idea for extracting reservoir operation rules is to obtain optimized operation samples through reservoir optimization operation models based on long-series historical runoff data, establish a reasonable reservoir operation rule extraction model, and mine the information in the optimized operation samples to obtain explicit or implicit operation functions. Most of the research on this type of method adopts a fixed operation function form, that is, fixed input factors and decision variables, and uses multiple linear regression, intelligent algorithms, data mining and other methods to extract reservoir operation rules. The research focuses on seeking a more efficient and accurate operation rule extraction model to provide technical support for reservoir operation decisions. The operation rules of this method are solidified and single, and fail to fully consider the optimal match between input factors and decision variables in different time periods.
[0004] Therefore, establishing a two-way dynamic selection method between the input factors and decision variables of reservoir operation rules is the key to further improving the efficiency of reservoir operation and providing more accurate operation decisions. Summary of the invention
[0005] Purpose of the invention: The purpose of the present invention is to provide a method for extracting reservoir optimization scheduling rules with a dynamic time-varying structure, and to further improve the accuracy of reservoir scheduling rule extraction by establishing a time-varying scheduling function form.
[0006] Technical solution: A method for extracting reservoir optimization dispatching rules with a dynamic time-varying structure of the present invention comprises the following steps:
[0007] S1. Obtain basic data of reservoir operation;
[0008] S2, establishing a reservoir optimization dispatching model according to the basic data in step S1 to obtain an optimization dispatching scheme set;
[0009] S3, determine the candidate set of input factors and the candidate set of decision variables, organize the optimized scheduling solution set in step S2 into corresponding input factor set samples and decision variable set samples as the sample set of step S4, select 80% of the sample set as the training sample set, and the remaining 20% as the verification sample set;
[0010] S4, establishing a dispatch rule extraction model based on random forest, using the training sample set in step S3 to train the dispatch rule extraction model based on random forest, and using the verification sample set to further verify the generalization ability of the dispatch rule extraction model;
[0011] S5, constructing a reservoir dispatching rule accuracy evaluation index to evaluate the fitting accuracy of the dispatching rule extraction model in step S4;
[0012] S6, establishing an input factor importance calculation model based on a gradient boosting algorithm, calculating the importance score of the input factor for a certain decision variable, finding the input factors with the highest and lowest scores, and using them for the optimal selection of input factors for the reservoir dispatching rule in step S7;
[0013] S7, reservoir dispatching rule input factor optimization: for a certain decision variable, select the candidate input factors with the highest scores in turn according to the input factor importance calculation model, and combine the dispatching rule extraction model in step S4 and the accuracy evaluation index in step S5 to determine whether the selected input factors are introduced into the input factor optimization set; after traversing all the input factors, select the input factors with the lowest scores in the input factor optimization set in turn according to the input factor importance calculation model, and combine the dispatching rule extraction model in step S4 and the accuracy evaluation index in step S5 to determine whether the selected input factors are removed from the input factor optimization set, and obtain the final input factor optimization set corresponding to the decision variable; for each time period of each decision variable, the above optimization process is carried out to obtain the input factor optimization set of each decision variable in each time period;
[0014] S8. Optimization of decision variables for reservoir dispatching rules: Based on the optimization results of the input factors in step S7, all decision variables in the decision variable candidate set are converted into the same decision variable form, and their fitting accuracy is calculated, and the decision variables are optimized for each time period.
[0015] Furthermore, in step S1, basic reservoir scheduling data are obtained, including basic reservoir characteristic curves and long-series reservoir runoff data, wherein the basic reservoir characteristic curves include water level storage capacity curves, tailwater level flow curves and water consumption rate curves, and the basic reservoir scheduling data are used as input to the reservoir optimization scheduling model in step S2.
[0016] Furthermore, step S2 specifically includes the following steps:
[0017] S21, objective function; the optimization goal is to maximize the total power generation benefit of the reservoir during the dispatch period:
[0018]
[0019] Where T is the total number of time periods; t is the time period number; prc tis the on-grid electricity price of the hydropower station in time period t; N t is the output of the hydropower station in time period t; △t t is the time period length of the tth period;
[0020] S22. Constraints:
[0021] ① Water balance constraints:
[0022] V t+1 =V t +(I t -O t )·△t t (2);
[0023] O t =Qr t +Qs t (3);
[0024] Among them, V t+1 and V t are the water storage capacity of the reservoir at the end and beginning of the t period respectively; I t and O t are the inflow and outflow of the reservoir in period t respectively; Qr t and Qs t are the power generation flow and abandoned water flow of the reservoir in time period t respectively;
[0025] ②Water level constraint:
[0026]
[0027] |Z t+1 -Z t |≤dZ t (5);
[0028] Among them, Z t , are the calculated water level, lower limit water level and upper limit water level of the reservoir at time t respectively; Z t+1 is the water level of the reservoir at the end of the tth period; dZ t is the maximum water level variation of the reservoir in period t;
[0029] ③Flow constraints:
[0030]
[0031] in, The minimum discharge flow of the reservoir in period t considering the downstream ecology and water supply needs; is the maximum flow capacity of the unit in the tth period of the hydropower station;
[0032] ④ Output constraints:
[0033]
[0034] N t =γ·Qr t / k(H t ) (8);
[0035] Among them, N t , β t are the calculated output, guaranteed output, and load rate of the hydropower station in the tth period, respectively; NY is the installed capacity of the hydropower station; k(·) is the water consumption rate of the hydropower station, which is the head H of the reservoir in the tth period. t function; γ is the unit conversion coefficient;
[0036] The optimization scheduling model is run with the long series runoff data of the reservoir as input to obtain the reservoir optimization scheduling plan set; the optimization scheduling plan set refers to the optimal values of relevant factors in the reservoir operation obtained by the reservoir optimization scheduling model under the set water inflow conditions, including the water level and storage capacity at each moment during the reservoir scheduling period, the inflow, outflow, power generation flow, abandoned water flow, unit consumption, output, power generation, and power generation efficiency in each time period.
[0037] Furthermore, step S3 specifically includes the following steps:
[0038] S31, the candidate set of input factors includes basic factors and derived factors, the basic factors are the inflow I of the first two periods and the period to be faced t-2 ,I t-1 ,I t , the initial water level Z of the first two periods and the period facing t-2 , Z t-1 , Z t , the outbound flow in the first two periods is O t-2 , O t-1 ; The derived factor is the reservoir energy input EI t , Energy Storage ES t , energy input and energy storage product EIS t , superimposed water level Za t , of which reservoir energy input EI t The calculation formula is as follows:
[0039] EI t = k·I t ·h1·△t t (9);
[0040] Among them, k is the output coefficient of the reservoir; h1 is the reservoir at △t t The generating head during the period;
[0041] Reservoir Energy Storage ES tThe calculation formula is as follows:
[0042] ES t = k·(V t-1 -V s )·h2 (10);
[0043] Among them, V s V is the dead storage capacity of the reservoir; t-1 is the storage capacity corresponding to the initial water level in period t; h2 is the average hydraulic head of the reservoir in the initial storage state;
[0044] Energy input storage product EIS t The calculation formula is as follows:
[0045] EIS t =EI t ·ES t (11);
[0046] Among them, EI t is the energy input to the reservoir during period t; ES t is the energy storage of the reservoir during period t;
[0047] Superimposed water level Za t The calculation formula is as follows:
[0048] Za t =φ(V t +I t ·△t t ) (12);
[0049] Among them, φ is the water level storage capacity relationship conversion symbol; V t I is the storage capacity corresponding to the initial water level in period t; t is the inflow flow in period t;
[0050] Input factor candidate set: X = {I t-2 ,I t-1 ,I t , Z t-2 , Z t-1 , Z t , O t-2 , O t-1 , EI t ,ES t 、EIS t , Za t};
[0051] S32, the candidate set of decision variables includes the water level Z at the end of the period t faced by the reservoir t+1 , outbound flow rate during the period O t , Output in time period N t ; That is, the candidate set of decision variables Y = {Z t+1, O t 、N t};
[0052] S33. According to the optimal scheduling solution set obtained in step S2, and the selection and calculation methods of the input factor candidate set and the decision variable candidate set in steps S31 and S32, the samples are sorted into corresponding input factor set samples and decision variable set samples.
[0053] S34, normalization processing, converting the data in the input factor set samples and decision variable set samples to the [0,1] interval to eliminate the impact of the dimension on the results. The calculation formula is as follows:
[0054]
[0055] Where f is the input factor or decision variable; f max is the maximum value of the input factor or decision variable; f min is the minimum value of the input factor or decision variable;
[0056] The normalized samples are used as the sample set in step S4, 80% of the sample set is selected as the training sample set, and the remaining 20% is used as the verification sample set.
[0057] Furthermore, in step S4, a scheduling rule extraction model based on random forest is established, which specifically includes the following steps:
[0058] S41. A reservoir optimization dispatching rule extraction model is constructed using a random forest regression algorithm. The specific programming is the random forest regression algorithm in the sklearn machine learning library in Python language. The particle swarm algorithm is used to optimize two hyperparameters in the random forest regression algorithm: the number of decision trees n and the number of features randomly selected by each decision tree l.
[0059] S42. Select a training sample set to train a dispatch rule extraction model based on random forest, and use the verification sample set as input of the trained dispatch rule extraction model based on random forest to verify the generalization ability of the model.
[0060] Furthermore, in step S5, a reservoir dispatching rule accuracy evaluation index is constructed, and specifically the root mean square error RMSE is selected as the reservoir dispatching rule accuracy evaluation index. The calculation formula of the root mean square error RMSE is as follows:
[0061]
[0062] Where n is the number of samples; y obs,i is the decision variable value in the optimized scheduling solution set in step S2; model,iThe decision variable value calculated by the dispatch rule extraction model based on random forest in step S4; the decision variable refers to the decision variable candidate set Y={Z t+1 , O t 、N t}; the RMSE value reflects the deviation between the actual value of the decision variable in the optimization scheduling solution set and the calculated value of the decision variable in the scheduling rule extraction model. The smaller the RMSE value, the smaller the deviation and the higher the fitting accuracy of the model.
[0063] Furthermore, in step S6, an input factor importance calculation model based on a gradient boosting algorithm is established, which specifically includes the following steps:
[0064] (61) A gradient boosting algorithm is used to construct an input factor importance calculation model. Specifically, the GradientBoostingRegressor algorithm in the sklearn machine learning library in Python language is used for programming, and the model training is performed using the training sample set in step S3 as input;
[0065] (62) The gradient boosting algorithm calculates the average importance of each input factor in a single decision tree, that is, obtains the importance score of each input factor for the decision variable. The importance score is obtained by checking the feature_importances_ attribute of the trained model.
[0066] Furthermore, the optimization of the reservoir dispatching rule input factors in step S7 specifically includes the following steps:
[0067] S71. For the decision variable candidate set Y={Z t+1 , O t 、N t}, and T scheduling periods in the scheduling period, initializing j=1, t=1;
[0068] S72. Select the jth decision variable and perform optimal selection of input factors for the tth period:
[0069] S721, set the input factor candidate set X = {I t-2 ,I t-1 ,I t , Z t-2 , Z t-1 , Z t , O t-2 , O t-1 , EI t ,ES t 、EIS t , Za t}, the optimal set of input factors for the jth decision variable in the tth period {} represents an empty set, and the accuracy of the dispatch rule extraction model is initialized to 1000;
[0070] S722, input factor candidate set X, j-th decision variable y j Substitute the input factor importance calculation model in step S6, select the factor with the highest score and add it to the input factor optimization set And remove the factor from the input factor candidate set X;
[0071] S723, select the optimal set of input factors The jth decision variable y j Substitute the dispatch rule extraction model in step S4 to obtain the dispatch rule, and then use the accuracy evaluation index in step S5 to calculate the accuracy of the dispatch rule extraction model to determine whether the accuracy is improved. If the accuracy is improved, add the factor to the input factor optimization set. If the accuracy is not improved, remove the factor from the preferred set of input factors. Eliminate;
[0072] S724, determine whether the input factor candidate set X is an empty set, if not, go to step S722, if it is an empty set, go to step S725;
[0073] S725. Create an input factor traversal set X', and set the input factor traversal set X' = the input factor preferred set
[0074] S726, traverse the input factor set X', the j-th decision variable y j Substitute the input factor importance calculation model in step S6, select the factor with the lowest score from the input factor optimization set Remove it from the input factor traversal set X';
[0075] S727, optimally set the input factors Substitute the j-th decision variable y into the dispatch rule extraction model in step S4 to obtain the dispatch rule, and then use the accuracy evaluation index in step S5 to calculate the model accuracy to determine whether the accuracy has been improved. If the accuracy has been improved, the factor is removed from the input factor optimization set. If the accuracy is not improved, the factor is retained in the preferred set of input factors. middle;
[0076] S728. Determine whether the input factor traversal set X' is an empty set. If it is an empty set, the optimal set of input factors for the jth decision variable in the tth period has been obtained. Go to step S73; if it is not an empty set, go to step S726;
[0077] S73, let t=t+1, determine whether t>T holds, if not, go to step S72; if so, let j=j+1, determine whether j>J holds, if not, go to step S72; if so, end the calculation.
[0078] Furthermore, the reservoir dispatching rule decision variable optimization in step S8 specifically includes the following steps:
[0079] S81, for the T scheduling periods in the scheduling period, initialize t = 1; in the decision variable candidate set Y = {Z t+1 , O t 、N t}Select a variable as the benchmark decision variable
[0080] S82, optimizing the decision variables for the tth period:
[0081] S821, for the decision variable candidate set Y={Z t+1 , O t 、N t}, initialize j=1;
[0082] S822, the input factor is optimized The jth decision variable y j Substitute the dispatch rule extraction model in step S4 to obtain the dispatch rule and determine the decision variable y j Is it a benchmark decision variable? If yes, go to step S823; if no, change the dispatch rule by the decision variable y j The expression is converted into the benchmark decision variable The form of expression;
[0083] S823, substitute the converted dispatching rules into the accuracy evaluation index calculation model accuracy error in step S5 j,t ;
[0084] S824, let j=j+1, determine whether j>J is true, if not, go to step S822; if yes, go to step S825;
[0085] S825. Compare the precision errors of J decision variables j,t , j = 1, 2, ..., J, select the decision variable with the smallest accuracy as the optimal decision variable Y for time period t t * ;
[0086] S83, let t=t+1, determine whether t>T holds, if not, go to step S82; if so, end the calculation.
[0087] Beneficial effects: Compared with the prior art, the advantages of the reservoir optimization dispatching rule extraction method of the present invention with a dynamic time-varying structure are as follows: First, in view of the fixed dispatching function form adopted in the existing reservoir dispatching rule extraction method, the present invention establishes a time-varying dispatching function form to find the optimal match between the input factor and the decision variable in each dispatching period, thereby improving the accuracy of the reservoir dispatching rule; second, after determining the optimal match between the input factor and the decision variable in each dispatching period, the decision variable is optimized, which can further improve the accuracy of the dispatching decision. Through the two-way dynamic selection between the input factor and the decision variable, an efficient reservoir dispatching rule is obtained to maximize the benefits of the reservoir dispatching. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Figure 1 is a flow chart of the method of the present invention;
[0089] Figure 2 is a flow chart of the optimal selection of input factors of the reservoir dispatching rule of the present invention;
[0090] Figure 3 It is a flow chart of the optimal selection of decision variables for reservoir dispatching rules of the present invention;
[0091] Figure 4 It is a comparison chart of the results of the input factor optimization and the full factor of the present invention;
[0092] Figure 5 It is a comparison chart of the results of the decision variable optimization and the unified decision variable of the present invention. DETAILED DESCRIPTION
[0093] The technical solution of the present invention is further described in detail below through embodiments and in conjunction with the accompanying drawings.
[0094] In the following description, a large number of specific details are given in order to provide a more thorough understanding of the present invention. However, it is obvious to those skilled in the art that the present invention can be implemented without one or more of these details. In other examples, in order to avoid confusion with the present invention, some technical features known in the art are not described. The preferred embodiments of the present invention are described in detail below, but the present invention is not limited to the specific details in the above-mentioned embodiments. The above-mentioned embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention will also have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected. The scope of protection claimed in the present invention is defined by the attached claims and their equivalents.
[0095] like Figure 1 As shown, a method for extracting reservoir optimization dispatching rules with a dynamic time-varying structure according to the present invention comprises the following steps:
[0096] S1. Obtaining basic data of reservoir operation; the basic data of reservoir operation include: basic characteristic curves such as reservoir water level and storage capacity curve, tailwater level flow curve, water consumption rate curve, as well as basic data such as long series runoff data of the reservoir, and the basic data of reservoir operation is used as input of the reservoir optimization operation model in step S2.
[0097] S2, establishing a reservoir optimization dispatching model according to the basic data in step S1 to obtain an optimization dispatching scheme set;
[0098] The reservoir optimization operation model is as follows:
[0099] S21, objective function; the optimization goal is to maximize the total power generation benefit of the reservoir during the dispatch period:
[0100]
[0101] Where T is the total number of time periods; t is the time period number; prc t is the on-grid electricity price of the hydropower station in time period t; N t is the output of the hydropower station in time period t; △t t is the length of the tth period.
[0102] S22. Constraints:
[0103] ① Water balance constraints:
[0104] V t+1 =V t +(I t -O t )·△t t (2);
[0105] O t =Qr t +Qs t (3);
[0106] Among them, V t+1 and V t are the water storage capacity of the reservoir at the end and beginning of the t period respectively; I t and O t are the inflow and outflow of the reservoir in period t respectively; Qr t and Qs t are respectively the power generation flow and water abandonment flow of the reservoir in time period t.
[0107] ②Water level constraint:
[0108]
[0109] |Z t+1 -Z t |≤dZt (5);
[0110] Among them, Z t , are the calculated water level, lower limit water level and upper limit water level of the reservoir at time t respectively; Z t+1 is the water level of the reservoir at the end of the tth period; dZ t is the maximum water level variation of the reservoir in period t.
[0111] ③Flow constraints:
[0112]
[0113] in, The minimum discharge flow of the reservoir in period t considering the downstream ecology and water supply needs; It is the maximum flow capacity of the unit in the tth period of the hydropower station.
[0114] ④ Output constraints:
[0115]
[0116] N t =γ·Qr t / k(H t ) (8);
[0117] Among them, N t , β t are the calculated output, guaranteed output, and load rate of the hydropower station in the tth period, respectively; NY is the installed capacity of the hydropower station; k(·) is the water consumption rate of the hydropower station, which is the head H of the reservoir in the tth period. t function; γ is the unit conversion coefficient.
[0118] The optimization scheduling model is run with the long series runoff data of the reservoir as input to obtain the reservoir optimization scheduling plan set; the optimization scheduling plan set refers to the optimal values of relevant factors in the reservoir operation obtained by the reservoir optimization scheduling model under the set water inflow conditions, including the water level and storage capacity at each moment during the reservoir scheduling period, the inflow, outflow, power generation flow, abandoned water flow, unit consumption, output, power generation, and power generation efficiency in each time period.
[0119] S3, determine the candidate set of input factors and the candidate set of decision variables, organize the optimized scheduling solution set in step S2 into corresponding input factor set samples and decision variable set samples as the sample set of step S4, select 80% of the sample set as the training sample set, and the remaining 20% as the verification sample set; specifically, the following steps are included:
[0120] S31, the candidate set of input factors consists of two parts: basic factors and derived factors. The basic factors can be obtained from the optimized scheduling solution set in step S2. The basic factors are the inflow flow I of the first two time periods and the facing time period. t-2 ,I t-1 ,I t , the initial water level Z of the first two periods and the period facing t-2 , Z t-1 , Z t , the outbound flow in the first two periods O t-2 , O t-1 , that is, the basic factor is {I t-2 ,I t-1 ,I t , Z t-2 , Z t-1 , Z t , O t-2 , O t-1}; The derived factor is the reservoir energy input EI t , Energy Storage ES t , energy input and energy storage product EIS t , superimposed water level Za t , that is, the derivative factor is {EI t ,ES t 、EIS t , Za t}, the derived factors need to be further calculated based on the optimized scheduling solution set.
[0121] The reservoir energy input EI t The calculation formula is as follows:
[0122] EI t = k·I t ·h1·△t t (9);
[0123] Among them, k is the output coefficient of the reservoir; h1 is the power generation head of the reservoir in the △t period;
[0124] Reservoir Energy Storage ES t The calculation formula is as follows:
[0125] ES t = k·(V t-1 -V s )·h2 (10);
[0126] Among them, V s V is the dead storage capacity of the reservoir; t-1 is the storage capacity corresponding to the initial water level in period t; h2 is the average hydraulic head of the reservoir in the initial storage state;
[0127] Energy input storage product EIS tThe calculation formula is as follows:
[0128] EIS t =EI t ·ES t (11);
[0129] Among them, EI t is the energy input to the reservoir during period t; ES t is the energy storage of the reservoir during period t;
[0130] Superimposed water level Za t The calculation formula is as follows:
[0131] Za t =φ(V t +I t ·△t t ) (12);
[0132] Among them, φ is the water level storage capacity relationship conversion symbol; V t I is the storage capacity corresponding to the initial water level in period t; t is the inflow flow in period t;
[0133] The candidate set of input factors is obtained as follows:
[0134] X={I t-2 ,I t-1 ,I t , Z t-2 , Z t-1 , Z t , O t-2 , O t-1 , EI t ,ES t 、EIS t , Za t}.
[0135] S32, the candidate set of decision variables includes the water level Z at the end of the period t faced by the reservoir t+1 , outbound flow rate during the period O t , Output in time period N t ; That is, the candidate set of decision variables Y = {Z t+1 , O t 、N t}; The decision variable candidate sets can all be obtained from the optimized scheduling solution set in step S2.
[0136] S33. According to the optimal scheduling solution set obtained in step S2, and the selection and calculation methods of the input factor candidate set and the decision variable candidate set in steps S31 and S32, the samples are sorted into corresponding input factor set samples and decision variable set samples.
[0137] S34, normalization processing, converting the data in the input factor set samples and decision variable set samples to the [0,1] interval to eliminate the impact of the dimension on the results. The calculation formula is as follows:
[0138]
[0139] Where f is the input factor or decision variable; f max is the maximum value of the input factor or decision variable; f min is the minimum value of the input factor or decision variable;
[0140] The normalized samples are used as the sample set in step S4, 80% of the sample set is selected as the training sample set, and the remaining 20% is used as the verification sample set.
[0141] S4, establishing a dispatch rule extraction model based on random forest, using the training sample set in step S3 to train the dispatch rule extraction model based on random forest, and using the verification sample set to further verify the generalization ability of the model;
[0142] The dispatch rule extraction model based on random forest can be programmed using the random forest regression algorithm in the sklearn machine learning library in Python language, but is not limited to this programming method; the particle swarm algorithm is used to optimize two hyperparameters in the random forest regression algorithm: the number of decision trees n and the number of features randomly selected by each decision tree l.
[0143] The training sample set in step S3 is used to train the dispatch rule extraction model based on random forest, and the verification sample set is used as the input of the trained dispatch rule extraction model based on random forest to verify the generalization ability of the model.
[0144] There are many methods that can be used to extract reservoir scheduling rules, such as multivariate linear regression model, BP neural network model, random forest regression model, etc. Here, the random forest regression model is selected for the extraction of reservoir scheduling rules, but the present invention is not limited to this model, and any applicable model can be used as the reservoir scheduling rule extraction model.
[0145] Similarly, there are many programming methods for implementing the random forest regression model, such as Python, MATLAB, R language, etc. The sklearn machine learning library under Python language is selected here, but the present invention is not limited to this programming method and can be implemented in any applicable programming language.
[0146] S5, constructing a reservoir dispatching rule accuracy evaluation index to evaluate the fitting accuracy of the dispatching rule extraction model in step S4;
[0147] The specific evaluation index of reservoir operation rule accuracy can be selected as the root mean square error RMSE, but it is not limited to this index. The calculation formula of the root mean square error RMSE is as follows:
[0148]
[0149] Where n is the number of samples; y obs,i is the decision variable value in the optimized scheduling solution set in step S2; model,i The decision variable value calculated by the dispatch rule extraction model based on random forest in step S4; the decision variable refers to the decision variable candidate set Y={Z t+1 , O t 、N t}; the RMSE value reflects the deviation between the actual value of the decision variable in the optimization scheduling solution set and the calculated value of the decision variable in the scheduling rule extraction model. The smaller the RMSE value, the smaller the deviation and the higher the fitting accuracy of the model.
[0150] S6, establishing an input factor importance calculation model based on a gradient boosting algorithm, calculating the importance score of the input factor for a certain decision variable, finding the input factors with the highest and lowest scores, and using them for the optimal selection of input factors for the reservoir dispatching rule in step S7;
[0151] The input factor importance calculation model based on the gradient boosting algorithm in step S5 can be programmed using the GradientBoostingRegressor algorithm in the sklearn machine learning library in Python language, but is not limited to this programming method. The model is trained with the training sample set in step S3 as input, and the importance score of each input factor for the decision variable can be obtained by checking the feature_importances_ attribute of the trained model.
[0152] There are many methods that can be used to calculate the importance of input factors, such as gradient boosting algorithm, linear regression algorithm, extreme random forest algorithm, etc. The gradient boosting algorithm is selected here to calculate the importance of input factors, but the present invention is not limited to this algorithm, and any applicable algorithm can be used to calculate the importance of input factors.
[0153] S7. Optimization of input factors of reservoir dispatching rules: for a certain decision variable, select the candidate input factors with the highest scores in turn according to the input factor importance calculation model, and combine the dispatching rule extraction model and the precision evaluation index to determine whether the selected input factors are introduced into the input factor optimization set; after traversing all the input factors, select the input factors with the lowest scores in the input factor optimization set in turn according to the input factor importance calculation model, and combine the dispatching rule extraction model and the precision evaluation index to determine whether the selected input factors are removed from the input factor optimization set, and obtain the final input factor optimization set corresponding to the decision variable; for each time period of each decision variable, the above optimization process is carried out to obtain the input factor optimization set of each decision variable in each time period;
[0154] like Figure 2 The step S7 specifically includes the following sub-steps:
[0155] S71. For the decision variable candidate set Y={Z t+1 , O t 、N t}, and T scheduling periods in the scheduling period, with j=1 and t=1 initialized; in this embodiment, Y={Z t+1 , O t 、N t}, the total dispatching period of reservoir dispatching is one year, and the dispatching period is one month, then J=3, T=12.
[0156] S72. Select the jth decision variable and perform optimal selection of input factors for the tth period:
[0157] S721, set the input factor candidate set X = {I t-2 ,I t-1 ,I t , Z t-2 , Z t-1 , Z t , O t-2 , O t-1 , EI t ,ES t 、EIS t , Za t}, the optimal set of input factors for the jth decision variable in the tth period {} represents an empty set, and the accuracy of the dispatch rule extraction model is initialized to 1000;
[0158] S722, input factor candidate set X, j-th decision variable y j Substitute the input factor importance calculation model in step S6, select the factor with the highest score and add it to the input factor optimization set And remove the factor from the input factor candidate set X;
[0159] S723, select the optimal set of input factors The jth decision variable y j Substitute the dispatch rule extraction model in step S4 to obtain the dispatch rule, and then use the accuracy evaluation index in step S5 to calculate the accuracy of the dispatch rule extraction model to determine whether the accuracy is improved. If the accuracy is improved, add the factor to the input factor optimization set. If the accuracy is not improved, remove the factor from the preferred set of input factors. Eliminate;
[0160] S724, determine whether the input factor candidate set X is an empty set, if not, go to step S722, if it is an empty set, go to step S725;
[0161] S725. Create an input factor traversal set X', and set the input factor traversal set X' = the input factor preferred set
[0162] S726, traverse the input factor set X', the j-th decision variable y j Substitute the input factor importance calculation model in step S6, select the factor with the lowest score from the input factor optimization set Remove it from the input factor traversal set X';
[0163] S727, optimally set the input factors Substitute the j-th decision variable y into the dispatch rule extraction model in step S4 to obtain the dispatch rule, and then use the accuracy evaluation index in step S5 to calculate the model accuracy to determine whether the accuracy has been improved. If the accuracy has been improved, the factor is removed from the input factor optimization set. If the accuracy is not improved, the factor is retained in the preferred set of input factors. middle;
[0164] S728. Determine whether the input factor traversal set X' is an empty set. If it is an empty set, the optimal set of input factors for the jth decision variable in the tth period has been obtained. Go to step S73; if it is not an empty set, go to step S726;
[0165] S73, let t=t+1, determine whether t>T holds, if not, go to step S72; if so, let j=j+1, determine whether j>J holds, if not, go to step S72; if so, end the calculation.
[0166] S8. Optimization of decision variables for reservoir dispatching rules: Based on the optimization results of the input factors in step S7, all decision variables in the decision variable candidate set are converted into the same decision variable form, and their fitting accuracy is calculated, and the decision variables are optimized for each time period.
[0167] like Figure 3 As shown, step S8 specifically includes the following sub-steps:
[0168] S81, for the T scheduling periods in the scheduling period, initialize t = 1; in the decision variable candidate set Y = {Z t+1 , O t 、N t}Select a variable as the benchmark decision variable In this embodiment, J=3, T=12, and the benchmark decision variable
[0169] S82, optimizing the decision variables for the tth period:
[0170] S821, for the decision variable candidate set Y={Z t+1 , O t 、N t}, initialize j=1.
[0171] S822, the input factor is optimized The jth decision variable y j Substitute the dispatch rule extraction model in step S4 to obtain the dispatch rule and determine the decision variable y j (y j ∈{Z t+1 , O t 、N t}) Is it a benchmark decision variable? If yes, go to step S823; if no, change the dispatch rule by the decision variable y j The expression is converted into the benchmark decision variable form of expression.
[0172] S823, substitute the converted dispatching rules into the accuracy evaluation index calculation model accuracy error in step S5 j,t .
[0173] S824, let j=j+1, determine whether j>J holds, if not, go to step S822; if so, go to step S825.
[0174] S825. Compare the precision errors of J decision variables j,t (j=1,2,...,J), select the decision variable with the smallest accuracy as the optimal decision variable Y for time period t t * .
[0175] S83, let t=t+1, determine whether t>T holds, if not, go to step S82; if so, end the calculation.
[0176] Comparative analysis:
[0177] Figure 4 The figure shows the comparison of the results of using the reservoir dispatching rule input factor optimization (step S7) of the present invention and not performing input factor optimization (ie, full factor, using all factors in the input factor candidate set to extract the dispatching rule). Figure 4 (a) to Figure 4 (c) is the RMSE value of the dispatch rule fitting for each of the 12 periods in the dispatch period, where Figure 4 The decision variable in (a) is the water level Z at the end of the period. t+1 , Figure 4 The decision variable in (b) is the outbound flow rate O during the period t , Figure 4 The decision variable in (c) is the output N in the time period t Except for June and September with the water level at the end of the time period as the decision variable, March with the outflow rate as the decision variable, and September with the output as the decision variable, the RMSE value of the full factor is smaller than the factor optimization, the RMSE values of the factor optimization in other cases are all smaller than the full factor, indicating that the input factor optimization in the present invention is suitable for most cases. Figure 4 (d) is the RMSE value of the dispatch rule fitting for the entire 12-month dispatch period. From the perspective of the entire dispatch period, taking the water level at the end of the period as the decision variable, the RMSE value of the optimal factor in the training period is 1.08m, the full factor is 1.21m, and the accuracy is improved by 10.74%. The RMSE value of the optimal factor in the validation period is 3.85m, the full factor is 4.00m, and the accuracy is improved by 3.75%. Taking the outflow flow as the decision variable, the RMSE value of the optimal factor in the training period is 22.61m 3 / s, the total factor is 25.10m 3 / s, the accuracy is improved by 9.92%, and the RMSE value of the validation period factor optimization is 78.76m 3 / s, the total factor is 83.22m 3 / s, the accuracy is improved by 5.36%; taking output as the decision variable, the RMSE value of the training period factor is 24,800 kW, the total factor is 28,400 kW, the accuracy is improved by 12.68%, and the RMSE value of the verification period factor is 95,300 kW, the total factor is 99,400 kW, the accuracy is improved by 4.12%. It shows that the optimization of the input factors of the reservoir dispatching rules of the present invention can effectively improve the extraction accuracy of the dispatching rules.
[0178] Figure 5 The figure shows the comparison of the results of using the reservoir dispatching rule decision variable optimization (step S8) of the present invention and not performing decision variable optimization (ie, unifying the decision variables, using the same decision variables for all time periods). Figure 5(a) is the result of optimizing the decision variables for each period, that is, based on the optimization of input factors, the decision variable is the outbound flow rate O in each period. t and output N t The result is converted into the water level Z at the end of the period t+1 The expression forms are respectively calculated, and the RMSE values after the expression forms are converted are selected, and the one with the smallest RMSE value is selected as the optimal decision variable for this period. In this embodiment, the optimal result of the decision variable for 12 months is {O t 、N t , O t , O t , Z t+1 , O t , Z t+1 , O t , Z t+1 , Z t+1 , Z t+1 , O t}. Figure 5 (b) shows the RMSE value of the scheduling rule fitting when the unified decision variables are used in the whole scheduling period and the decision variables are optimized. It can be seen that the RMSE value of the water level at the end of the period is 1.99m, the RMSE value of the outflow is 1.81m (after the expression form conversion), the RMSE value of the output is 1.95m (after the expression form conversion), and the RMSE value of the optimal decision variables is 1.74m (after the expression form conversion). Compared with the unified decision variables, the optimal decision variables are more accurate. The accuracy of the decision variables after optimization is improved by 12.32%, 3.52% and 10.54% respectively; the RMSE value of the water level at the end of the period is 3.85m for the decision variables in the validation period, the RMSE value of the outflow is 3.58m (after the expression form conversion), the RMSE value of the output is 3.80m (after the expression form conversion), and the RMSE value of the optimal decision variables is 3.51m (after the expression form conversion). Compared with the unified decision variables, the accuracy of the decision variables after optimization is improved by 8.91%, 2.13% and 7.68% respectively. It shows that the optimization of the decision variables of the reservoir dispatching rules of the present invention can further improve the extraction accuracy of the dispatching rules after the input factors are optimized.
Claims
1. A method for extracting reservoir optimization dispatching rules with dynamic time-varying structure, characterized in that: The following steps are involved: S1. Obtain basic data of reservoir operation; S2, establishing a reservoir optimization dispatching model according to the basic data in step S1 to obtain an optimization dispatching scheme set; specifically comprising the following steps: S21, objective function; the optimization goal is to maximize the total power generation benefit of the reservoir during the dispatch period: Where T is the total number of time periods; t is the time period number; prc t is the on-grid electricity price of the hydropower station in time period t; N t is the output of the hydropower station in time period t; △t t is the time period length of the tth period; S22. Constraints: ① Water balance constraints: V t+1 =V t +(I t -O t )·△t t (2); O t =Qr t +Qs t (3); Among them, V t+1 and V t are the water storage capacity of the reservoir at the end and beginning of the t period respectively; I t and O t are the inflow and outflow of the reservoir in period t respectively; Qr t and Qs t are the power generation flow and abandoned water flow of the reservoir in time period t respectively; ②Water level constraint: |From t+1 -WITH t |≤dZ t (5); Among them, Z t , are the calculated water level, lower limit water level and upper limit water level of the reservoir at time t respectively; Z t+1 is the water level of the reservoir at the end of period t; dZ t is the maximum water level variation of the reservoir in period t; ③Flow constraints: in, The minimum discharge flow of the reservoir in period t considering the downstream ecology and water supply needs; is the maximum flow capacity of the unit in the tth period of the hydropower station; ④ Output constraints: N t =γ·Qr t / k(H t ) (8); Among them, N t , β t are the calculated output, guaranteed output, and load rate of the hydropower station in the tth period, respectively; NY is the installed capacity of the hydropower station; k(·) is the water consumption rate of the hydropower station, which is the head H of the reservoir in the tth period. t function; γ is the unit conversion coefficient; The optimization scheduling model is run with the long series runoff data of the reservoir as input to obtain the reservoir optimization scheduling plan set; the optimization scheduling plan set refers to the optimal values of relevant factors in the reservoir operation obtained by the reservoir optimization scheduling model under the set water inflow conditions, including the water level and storage capacity at each time during the reservoir scheduling period, the inflow, outflow, power generation flow, abandoned water flow, unit consumption, output, power generation, and power generation efficiency in each period; S3, determine the candidate set of input factors and the candidate set of decision variables, organize the optimized scheduling solution set in step S2 into corresponding input factor set samples and decision variable set samples as the sample set of step S4, select 80% of the sample set as the training sample set, and the remaining 20% as the verification sample set; S4, establishing a dispatch rule extraction model based on random forest, using the training sample set in step S3 to train the dispatch rule extraction model based on random forest, and using the verification sample set to further verify the generalization ability of the dispatch rule extraction model; S5, constructing a reservoir dispatching rule accuracy evaluation index to evaluate the fitting accuracy of the dispatching rule extraction model in step S4; S6, establishing an input factor importance calculation model based on a gradient boosting algorithm, calculating the importance score of the input factor for a certain decision variable, finding the input factors with the highest and lowest scores, and using them for the optimal selection of input factors for the reservoir dispatching rule in step S7; S7, reservoir dispatching rule input factor optimization: for a certain decision variable, select the candidate input factors with the highest scores in turn according to the input factor importance calculation model, and combine the dispatching rule extraction model in step S4 and the accuracy evaluation index in step S5 to determine whether the selected input factors are introduced into the input factor optimization set; after traversing all the input factors, select the input factors with the lowest scores in the input factor optimization set in turn according to the input factor importance calculation model, and combine the dispatching rule extraction model in step S4 and the accuracy evaluation index in step S5 to determine whether the selected input factors are removed from the input factor optimization set, and obtain the final input factor optimization set corresponding to the decision variable; for each time period of each decision variable, the above optimization process is carried out to obtain the input factor optimization set of each decision variable in each time period; S8. Optimization of decision variables for reservoir dispatching rules: Based on the optimization results of the input factors in step S7, all decision variables in the decision variable candidate set are converted into the same decision variable form, and their fitting accuracy is calculated, and the decision variables are optimized for each time period.
2. The method for extracting reservoir optimization dispatching rules with dynamic time-varying structure according to claim 1 is characterized in that: In step S1, basic reservoir operation data are obtained, including basic reservoir characteristic curves and long-term reservoir runoff data, wherein the basic reservoir characteristic curves include water level storage capacity curves, tailwater level flow curves and water consumption rate curves. The basic reservoir operation data are used as inputs to the reservoir optimization operation model in step S2.
3. The method for extracting reservoir optimization dispatching rules with dynamic time-varying structure according to claim 1 is characterized in that: Step S3 specifically includes the following steps: S31, the candidate set of input factors includes basic factors and derived factors, the basic factors are the inflow I of the first two periods and the period to be faced t-2 ,I t-1 ,I t , the initial water level Z of the first two periods and the period facing t-2 , Z t-1 , Z t , the outbound flow in the first two periods is O t-2 , O t-1 ; The derived factor is the reservoir energy input EI t , Energy Storage ES t , energy input and energy storage product EIS t , superimposed water level Za t , of which reservoir energy input EI t The calculation formula is as follows: NO t =k·I t ·h1·△t t (9); Among them, k is the output coefficient of the reservoir; h1 is the reservoir at △t t The generating head during the period; Reservoir Energy Storage ES t The calculation formula is as follows: IS t =k·(V t-1 -V s )·h2 (10); Among them, V s V is the dead storage capacity of the reservoir; t-1 is the storage capacity corresponding to the initial water level in period t; h2 is the average hydraulic head of the reservoir in the initial storage state; Energy input storage product EIS t The calculation formula is as follows: THIS t =EI t ·ES t (11); Among them, EI t is the energy input to the reservoir during period t; ES t is the energy storage of the reservoir during period t; Superimposed water level Za t The calculation formula is as follows: For t =φ(V t +I t ·△t t ) (12); Among them, φ is the water level storage capacity relationship conversion symbol; V t I is the storage capacity corresponding to the initial water level in period t; t is the inflow flow in period t; Input factor candidate set: X = {I t-2 ,I t-1 ,I t , Z t-2 , Z t-1 , Z t , O t-2 , O t-1 , EI t ,ES t 、EIS t , Za t }; S32, the candidate set of decision variables includes the water level Z at the end of the period t faced by the reservoir t+1 , outbound flow rate during the period O t , Output in time period N t ; That is, the candidate set of decision variables Y = {Z t+1 , O t 、N t }; S33, according to the optimal scheduling solution set obtained in step S2, and the selection and calculation methods of the input factor candidate set and the decision variable candidate set in steps S31 and S32, sorting into corresponding input factor set samples and decision variable set samples; S34, normalization processing, converting the data in the input factor set samples and decision variable set samples to the [0,1] interval to eliminate the impact of the dimension on the results. The calculation formula is as follows: Where f is the input factor or decision variable; f max is the maximum value of the input factor or decision variable; f min is the minimum value of the input factor or decision variable; The normalized samples are used as the sample set in step S4, 80% of the sample set is selected as the training sample set, and the remaining 20% is used as the verification sample set.
4. The method for extracting reservoir optimization dispatching rules with dynamic time-varying structure according to claim 1 is characterized in that: In step S4, a dispatching rule extraction model based on random forest is established, which specifically includes the following steps: S41. A reservoir optimization dispatching rule extraction model is constructed using a random forest regression algorithm. The specific programming is the random forest regression algorithm in the sklearn machine learning library in Python language. The particle swarm algorithm is used to optimize two hyperparameters in the random forest regression algorithm: the number of decision trees n and the number of features randomly selected by each decision tree l. S42. Select a training sample set to train a dispatch rule extraction model based on random forest, and use the verification sample set as input of the trained dispatch rule extraction model based on random forest to verify the generalization ability of the model.
5. The method for extracting reservoir optimization dispatching rules with dynamic time-varying structure according to claim 1 is characterized in that: In step S5, a reservoir dispatching rule accuracy evaluation index is constructed, and specifically the root mean square error RMSE is selected as the reservoir dispatching rule accuracy evaluation index. The calculation formula of the root mean square error RMSE is as follows: Where n is the number of samples; y obs,i is the decision variable value in the optimized scheduling solution set in step S2; model,i The decision variable value calculated by the dispatch rule extraction model based on random forest in step S4; the decision variable refers to the decision variable candidate set Y={Z t+1 , O t 、N t }; the RMSE value reflects the deviation between the actual value of the decision variable in the optimization scheduling solution set and the calculated value of the decision variable in the scheduling rule extraction model. The smaller the RMSE value, the smaller the deviation and the higher the fitting accuracy of the model.
6. The method for extracting reservoir optimization dispatching rules with dynamic time-varying structure according to claim 1 is characterized in that: In step S6, an input factor importance calculation model based on a gradient boosting algorithm is established, which specifically includes the following steps: (61) A gradient boosting algorithm is used to construct an input factor importance calculation model. Specifically, the GradientBoostingRegressor algorithm in the sklearn machine learning library in Python language is used for programming, and the model training is performed using the training sample set in step S3 as input; (62) The gradient boosting algorithm calculates the average importance of each input factor in a single decision tree, that is, obtains the importance score of each input factor for the decision variable. The importance score is obtained by checking the feature_importances_ attribute of the trained model.
7. The method for extracting reservoir optimization dispatching rules with dynamic time-varying structure according to claim 1 is characterized in that: The optimization of the reservoir dispatching rule input factors in step S7 specifically includes the following steps: S71. For the decision variable candidate set Y={Z t+1 , O t 、N t }, and T scheduling periods in the scheduling period, initializing j=1, t=1; S72. Select the jth decision variable and perform optimal selection of input factors for the tth period: S721, set the input factor candidate set X = {I t-2 ,I t-1 ,I t , Z t-2 , Z t-1 , Z t , O t-2 , O t-1 , EI t ,ES t 、EIS t , Za t }, the optimal set of input factors for the jth decision variable in the tth period {} represents an empty set, and the accuracy of the dispatch rule extraction model is initialized to 1000; S722, input factor candidate set X, j-th decision variable y j Substitute the input factor importance calculation model in step S6, select the factor with the highest score and add it to the input factor optimization set And remove the factor from the input factor candidate set X; S723, select the optimal set of input factors The jth decision variable y j Substitute the dispatch rule extraction model in step S4 to obtain the dispatch rule, and then use the accuracy evaluation index in step S5 to calculate the accuracy of the dispatch rule extraction model to determine whether the accuracy is improved. If the accuracy is improved, add the factor to the input factor optimization set. If the accuracy is not improved, remove the factor from the preferred set of input factors. Eliminate; S724, determine whether the input factor candidate set X is an empty set, if not, go to step S722, if it is an empty set, go to step S725; S725. Create an input factor traversal set X', and set the input factor traversal set X' = the input factor preferred set S726, traverse the input factor set X', the j-th decision variable y j Substitute the input factor importance calculation model in step S6, select the factor with the lowest score from the input factor optimization set Remove it from the input factor traversal set X'; S727, optimally set the input factors Substitute the j-th decision variable y into the dispatch rule extraction model in step S4 to obtain the dispatch rule, and then use the accuracy evaluation index in step S5 to calculate the model accuracy to determine whether the accuracy has been improved. If the accuracy has been improved, the factor is removed from the input factor optimization set. If the accuracy is not improved, the factor is retained in the preferred set of input factors. middle; S728. Determine whether the input factor traversal set X' is an empty set. If it is an empty set, the optimal set of input factors for the jth decision variable in the tth period has been obtained. Go to step S73; if it is not an empty set, go to step S726; S73, let t=t+1, determine whether t>T holds, if not, go to step S72; if so, let j=j+1, determine whether j>J holds, if not, go to step S72; if so, end the calculation.
8. The method for extracting reservoir optimization dispatching rules with dynamic time-varying structure according to claim 1 is characterized in that: The reservoir dispatching rule decision variable optimization in step S8 specifically includes the following steps: S81, for the T scheduling periods in the scheduling period, initialize t = 1; in the decision variable candidate set Y = {Z t+1 , O t 、N t }Select a variable as the benchmark decision variable S82, optimizing the decision variables for the tth period: S821, for the decision variable candidate set Y={Z t+1 , O t 、N t }, initialize j=1; S822, select the optimal set of input factors The jth decision variable y j Substitute the dispatch rule extraction model in step S4 to obtain the dispatch rule and determine the decision variable y j Is it a benchmark decision variable? If yes, go to step S823; if no, change the dispatch rule by the decision variable y j The expression is converted into the benchmark decision variable The form of expression; S823, substitute the converted dispatching rules into the accuracy evaluation index calculation model accuracy error in step S5 j,t ; S824, let j=j+1, determine whether j>J is true, if not, go to step S822; if yes, go to step S825; S825. Compare the precision errors of J decision variables j,t , j = 1, 2, ..., J, select the decision variable with the smallest accuracy as the optimal decision variable Y for time period t t * ; S83, let t=t+1, determine whether t>T holds, if not, go to step S82; if so, end the calculation.
Citation Information
Patent Citations
Reservoir stage power generation scheduling rule extraction method
CN107657349A
Method for extracting joint dispatching rules of cascade hydropower station group based on random forest
CN108647829A