A method for simulating and calculating reservoir flood discharge flow based on the LSTM model
The LSTM model-based method for reservoir flood simulation improves flood prediction and control by learning optimal discharge strategies, enhancing accuracy and intelligence in reservoir management.
Patent Information
- Application Number
- CN202510323352.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-03-19
AI Technical Summary
Traditional reservoir flood discharge scheduling methods are difficult to achieve optimal control in complex watershed environments, and the reaction is lagging in the face of sudden floods, making it difficult to take into account both safety and economic benefits.
The LSTM model is used to calculate the flood discharge flow rate simulation method of reservoirs. By collecting and pre-processing the historical operation characteristic data of the reservoir, a flood discharge scheduling model is established, combined with optimization algorithms to solve the flood discharge parameters, and the LSTM model is used to learn the flood discharge operation rules to realize intelligent flood discharge decisions.
The accuracy and intelligence level of reservoir flood discharge prediction are improved, and the adaptive optimal flood discharge parameters are achieved automatically, reducing human intervention, and improving scheduling efficiency and intelligence level are achieved.
Smart Images

Figure CN119830776B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of water conservancy projects and intelligent scheduling, and specifically relates to a method for simulating and calculating reservoir flood discharge flow based on the LSTM model. Background Art
[0002] Reservoir flood discharge scheduling is a core issue in water resources management, involving multiple objectives such as reservoir safety, downstream flood control, water supply, and ecological protection. Traditional scheduling methods mainly rely on empirical rules or rule bases. However, in a complex watershed environment, manual scheduling is often difficult to achieve optimal control, and it lags behind in the face of sudden floods, making it difficult to balance safety and economic benefits. In recent years, with the improvement of hydrological data acquisition capabilities and the development of artificial intelligence technology, intelligent scheduling methods based on deep learning have gradually become a research hotspot. As a neural network suitable for time-series data, the long short-term memory (LSTM) model can effectively learn the historical operation patterns of reservoir scheduling, providing new ideas for intelligent and automated flood discharge scheduling. Summary of the Invention
[0003] The present invention aims to improve the accuracy and intelligent level of reservoir flood discharge prediction, and proposes a method for simulating and calculating reservoir flood discharge flow based on the LSTM model to improve the simulation accuracy of reservoir flood discharge flow.
[0004] To solve the above technical problems, the technical solution adopted by the present invention is:
[0005] A method for simulating and calculating reservoir flood discharge flow based on the LSTM model, comprising:
[0006] S1. Collect historical operation characteristic data of the reservoir: Specifically include reservoir water level, inflow, flood discharge flow, and basic information related to flood discharge scheduling, and perform preprocessing on the data, including data cleaning, removing outliers, and filling missing data;
[0007] S2. Establish a reservoir flood discharge scheduling model: Construct a reservoir flood discharge scheduling model with flow matching, operation simplification, and operation continuity as optimization objectives, combine the reservoir operation characteristics, introduce constraint conditions, substitute the preprocessed data in step S1 into the reservoir flood discharge scheduling model, and use an optimization algorithm to solve the flood discharge parameters of the flood discharge structure;
[0008] S3. Create flood discharge operation "labels": Based on the optimized flood discharge parameters, associate the reservoir water level, inflow, and flood discharge operations, construct a "label" system for flood discharge operations, and construct a data set, and divide the data set into a calibration period and a verification period;
[0009] S4. Construct an LSTM model to learn flood discharge operation rules: During the calibration period, use the reservoir water level and inflow as inputs to train the LSTM model to make it learn the mapping relationship between the flood discharge operation "labels" and reservoir scheduling;
[0010] S5. Flood discharge operation during the simulation and verification period: Based on the trained LSTM model, simulate the reservoir flood discharge operations under different reservoir water levels and inflow conditions during the verification period to obtain the optimal flood discharge parameters.
[0011] S6. Flood discharge flow calculation: Combine the weir / opening flood discharge flow formula and use the optimal flood discharge parameters obtained in step S5 to calculate the flood discharge flow.
[0012] Furthermore, the historical operation characteristic data of the reservoir collected in step S1 are daily-scale data: reservoir water level, inflow, and flood discharge flow, to ensure the time resolution and data consistency of the model. The basic information related to flood discharge operation determines the constraints.
[0013] Furthermore, the objective functions of the reservoir flood discharge operation model in step S2 include flow matching, operation simplification, and operation continuity. The formulas for each objective function are as follows:
[0014] Flow matching objective f 1: Ensure that the simulated daily flood discharge flow Q total has the minimum error with the measured daily flood discharge flow Q measured :
[0015] ;
[0016] Among them, minimize(•) represents minimizing an objective function; Q measured is the measured daily flood discharge flow, and are the gate states of the i th spillway and the j th discharge hole in the flood discharge structure. The open state takes the value of 1, and the closed state takes the value of 0; and are the outflow rates corresponding to the i th spillway and the j th discharge hole in the flood discharge structure, i and j represent the m th spillway and the n th discharge hole respectively,
[0017] Operation simplification objective f 2: Control the number of weirs / openings opened every day. When the reservoir has multiple spillways / openings, the fewer the number of opened weirs / openings, the simpler the operation. Therefore, define the "weir / opening number optimization term" as follows:
[0018] ;
[0019] Operation continuity objective f 3: Ensure the stability of the daily flood discharge operation to reduce frequent opening / closing operations. Introduce an operation continuity optimization term by calculating the change value of the opening / closing state of the weir / hole between the current calculation period and the previous period:
[0020] ;
[0021] In the formula, and respectively represent t time and t-1 time, and the opening / closing state of the i rd flood discharge weir; and respectively represent t time and t-1 time, and the opening / closing state of the j th flood discharge hole.
[0022] The opening of adjacent two days should be kept as continuous as possible. The operation of the next day is based on the previous day, rather than closing one hole and then opening another hole.
[0023] Furthermore, perform normalization processing on the flow matching, operation simplification, and operation continuity objective functions in step S2 to obtain . The final objective function f of the reservoir flood discharge scheduling model is represented by the weighted sum of the three normalized objective functions:
[0024] ;
[0025] Among them, and are weight coefficients used to balance the relative importance of flow matching, operation simplification, and operation continuity objectives, and are determined according to the obtained basic information related to flood discharge scheduling.
[0026] Furthermore, the constraint conditions in step S2 include water balance constraint, water level constraint, discharge capacity constraint, operation sequence constraint, and weir / hole opening constraint:
[0027] Water balance constraint:
[0028] Among them, V ( t +1) and V ( t ) are respectively t +1 and t times the reservoir water storage; I ( t ) and O (t ) is the water inflow at time t (such as rainfall, upstream inflow, etc.) and the water outflow (such as power generation, downstream water use, etc.);
[0029] Water level constraint: The flood discharge operation should ensure that the water level is within a reasonable range:
[0030] ;
[0031] Among them, H min is the elevation of the top of the weir / opening, or the lowest water level at which the discharge opening is opened, H max refers to the highest water level that the reservoir is allowed to reach during flood discharge; H refers to the water level of the reservoir during flood discharge;
[0032] Discharge capacity constraint: Avoid excessive flood discharge flow in a short period of time:
[0033] ;
[0034] In the formula, represents t the total discharge at time represents t the maximum allowable flood discharge at time;
[0035] Operation sequence constraint: The operation sequence constraint conforms to the priority of reservoir operation.
[0036] Opening degree constraint: The opening degree of the opening should conform to the allowable opening degree range of the project.
[0037] Furthermore, the water balance constraint, the water level constraint, and the discharge capacity constraint are necessary constraint conditions for each reservoir building. Whether the operation sequence constraint and the opening degree constraint are required depends on the basic information related to flood discharge operation obtained.
[0038] The opening and closing of the gates of many reservoir buildings have a priority order. Most reservoir buildings have corresponding operation rules, which determine the constraint conditions. The constraint conditions are related to the basic information related to flood discharge operation obtained.
[0039] Furthermore, the optimization algorithm used to solve the flood discharge parameters in step S2 is the genetic algorithm, which mainly includes the following steps:
[0040] Initialization: Randomly generate a set of initial solutions for the opening and closing states and opening degrees of the weir / openings as the population;
[0041] Fitness calculation: Calculate the fitness of each individual according to the objective function. The lower the fitness value of an individual, the better. The fitness function is:
[0042]
[0043] Among them, f is the final objective function of the reservoir flood discharge scheduling model;
[0044] Selection: Select individuals to enter the next generation according to fitness (methods such as roulette wheel selection and tournament selection can be used);
[0045] Crossover: Perform crossover operations on the offspring to generate new solutions, and select some variables for exchange;
[0046] Mutation: Randomly change the opening state or discharge coefficient of a certain hole with a small probability to increase the population diversity;
[0047] Termination condition: Reach the preset number of generations or convergence criteria, and output the solution with the optimal current fitness.
[0048] Furthermore, the "labels" of the flood discharge operations in step S3 not only include the opening and closing states of each calculation period of different flood discharge buildings, but also include their opening settings. These information together constitute an important feature data set for training the LSTM model. Taking 70% of the data set length as the regular period and the remaining 30% as the validation period.
[0049] Furthermore, the single weir / hole flood discharge flow formula in step S6 is:
[0050]
[0051] Among them, C w and C c are the outflow coefficients of the spillway weir and the spillway hole respectively, which are related to the type of flood discharge building. B is the top width of the spillway weir. A is the cross-sectional area of the spillway hole. H d is the water head above the hole. Q w and Q c are the flood discharge flows of a single spillway weir and a single spillway hole in the flood discharge building respectively.
[0052] Advantages of the present invention:
[0053] The present invention combines optimization algorithms and deep learning technologies to transform reservoir scheduling from a traditional rule-based decision-making mode into a data-driven intelligent scheduling. It can automatically learn the best flood discharge parameters according to different water levels and inflows, achieve adaptive decision-making, reduce the need for human intervention, and improve the scheduling efficiency and intelligence level.
[0054] The present invention breaks through the limitations of traditional reservoir flood discharge scheduling methods and realizes intelligent, precise and real-time scheduling optimization. Brief Description of the Drawings
[0055] Figure 1 It is a schematic flow chart of the method of the present invention;
[0056] Figure 2 It is a schematic diagram of the discharge of flood discharge structures, where (a) is weir flow and (b) is orifice flow;
[0057] Figure 3 It is the simulation result of the flood discharge flow process line of the reservoir studied by the present invention;
[0058] Figure 4 It is a scatter plot of the flood discharge flow simulation of the reservoir studied by the present invention. Detailed Embodiments
[0059] The technical method of the present invention will be further described below in conjunction with the drawings and specific examples.
[0060] Embodiment
[0061] Taking the Ertan Reservoir in the Yalong River Basin as the research reservoir and the period from January 1, 2002 to December 31, 2018 as the research period, the flow chart of a method for simulating and calculating the flood discharge flow of a reservoir based on the LSTM model is as Figure 1 shown, and the specific implementation includes the following steps:
[0062] Step 1: Collect historical operation characteristic data of the reservoir: Specifically include reservoir water level, inflow, flood discharge flow, and basic information related to flood discharge scheduling, and preprocess the data, including data cleaning, removing outliers, and filling missing data;
[0063] The reservoir water level, inflow, and flood discharge flow data are all daily-scale data to ensure the time resolution and data consistency of the model, and the basic information related to flood discharge scheduling determines the constraints.
[0064] The basic information related to flood discharge scheduling includes the record table of flood discharge scheduling (including information such as inflow, outflow, water level, etc.), and also includes the operation principles of flood discharge structures, including the opening sequence of each orifice and operation requirements and other scheduling regulations.
[0065] Step 2: Establish a reservoir flood discharge scheduling model: Taking flow matching, operation simplification, and operation continuity as optimization objectives, combining the operation characteristics of the reservoir, introducing various constraints, and using an optimization algorithm to solve the flood discharge parameters of various flood discharge structures.
[0066] The objective function of the reservoir flood discharge scheduling model mainly includes flow matching, operation simplification, and operation continuity. The schematic diagrams of weir flow and orifice flow are as Figure 2 shown in (a) and (b) in the figure, and in the figure H d is the head above the orifice,Q w and Q c are the flood discharge flows of a single spillway weir and a single spillway hole respectively.
[0067] The ultimate objective function of the reservoir flood discharge operation model is a weighted combination among flow matching, operation simplification, and operation continuity.
[0068] Different flood discharge structures have different focuses. Some structures tend to prioritize operation continuity, which can reduce hydraulic fluctuations and the risk of equipment failures, thus giving priority to safety; some structures tend to focus on operation simplification, reducing the number of operations to save labor costs, but need to accept a certain switching frequency; therefore, the specific weights can be determined according to the actual situation of the structure.
[0069] The water balance constraint, water level constraint, and flood discharge capacity constraint are necessary constraint conditions for each reservoir structure. Whether the operation sequence constraint and opening degree constraint hold depends on the operation principle of the flood discharge structure. The operation rules of the Ertan Reservoir include that the surface outlets must operate symmetrically, the middle outlets are not allowed to operate with partial openings, and the priority of opening and closing the surface outlets is higher than that of the middle outlets. This embodiment requires the operation sequence constraint and the opening degree constraint.
[0070] Operation sequence constraint: The operation sequence constraint conforms to the priority of reservoir operation;
[0071] Opening degree constraint: The opening degree (discharge coefficient) of the hole C i (H) should conform to the allowable opening degree range of the project:
[0072]
[0073] In the formula, C min , C max represent the minimum / maximum opening degree ranges of the hole respectively.
[0074] The genetic algorithm is used to solve the flood discharge parameters of various flood discharge structures. The flood discharge structures of the Ertan Reservoir include 7 surface outlets, 6 middle outlets, and 2 flood discharge tunnels.
[0075] Step 3, create flood discharge operation "labels": Based on the optimized flood discharge parameters, associate the reservoir water level, inflow, and flood discharge operations, and construct a "label" system for flood discharge operations, and divide the data set into a calibration period and a verification period.
[0076] The "labels" of flood discharge operations not only include the opening and closing states of different flood discharge structures in each calculation period, but also their opening settings. These information together constitute an important feature dataset for training the LSTM model. Taking 70% of the dataset length as the training period and the remaining 30% as the validation period.
[0077] Step 4. Construct an LSTM model to learn the flood discharge operation rules: During the training period, using the reservoir water level and inflow as inputs, train the LSTM (Long Short-Term Memory) model to make it learn the mapping relationship between the "labels" of flood discharge operations and reservoir operation.
[0078] Step 5. Simulate the flood discharge operation during the validation period: Based on the trained LSTM model, simulate the reservoir flood discharge operations under different water levels and inflow conditions during the validation period to obtain the optimal flood discharge parameters;
[0079] Step 6. Calculate the flood discharge flow: The combined flood discharge flow formula for a single weir / hole is:
[0080]
[0081] where, C w and C c are the discharge coefficients of the spillway weir and the spillway hole respectively, B is the width of the spillway weir crest, A is the cross-sectional area of the spillway hole, H d is the water head above the hole, Q w and Q c are the flood discharge flows of a single spillway weir and a single spillway hole in the flood discharge structure respectively.
[0082] The sum of the flood discharge amounts of each weir / hole simulated per day gives the total flood discharge flow of the reservoir on that day.
[0083] The simulation results are as shown in Figure 3 and Figure 4 . Figure 3 where NSE in Figure 4 refers to the Nash efficiency coefficient, and RE refers to the relative error. In Figure 4 , CalBIAS and Cal R refer to the training period bias and correlation respectively, and Val BIAS and Val R refer to the validation period bias and correlation respectively. The model performs excellently during the training period, with strong trend capture ability. The NSE is 0.94, and the change trends of the simulated values and the observed values are highly consistent. However, the model performance decreases during the validation period, showing a relatively large systematic bias, but the trend consistency between the measured values and the simulated values is still good.
[0084] The above are only the preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. Any technical solutions falling within the concept of the present invention belong to the protection scope of the present invention. It should be noted that for those of ordinary skill in the art, several improvements and refinements made without departing from the principle of the present invention should be regarded as within the protection scope of the present invention.
Claims
1. A method for simulating and calculating reservoir flood discharge flow based on an LSTM model, characterized in that, Including: S1. Collect historical operation characteristic data of the reservoir: Specifically include reservoir water level, inflow, flood discharge flow, and basic information related to flood discharge scheduling. Preprocess the data, including data cleaning, removing outliers, and filling missing data. S2. Establish a reservoir flood discharge scheduling model: Construct a reservoir flood discharge scheduling model with the optimization objectives of flow matching, operation simplification, and operation continuity. Combine the reservoir operation characteristics, introduce constraint conditions, substitute the preprocessed data in step S1 into the reservoir flood discharge scheduling model, and use an optimization algorithm to solve the flood discharge parameters of the flood discharge structure. The objective functions of the reservoir flood discharge scheduling model include flow matching, operation simplification, and operation continuity. The formulas for each objective function are as follows: Flow matching target f1: Ensure that the simulated daily flood discharge Q total is minimized with respect to the measured daily flood discharge Q measured Error: Among them, minimize(·) represents the operation of minimizing an objective function, and Q measured is the measured daily flood discharge, and are the gate states of the i-th spillway weir and the j-th spillway hole in the flood discharge structure. The value for the open state is 1, and the value for the closed state is 0; and are the outflow discharges corresponding to the i-th spillway weir and the j-th spillway hole in the flood discharge structure. i and j represent the i-th spillway weir and the j-th spillway hole respectively, and m and n represent the total numbers of spillway weirs and spillway holes respectively; Operation simplification objective f2: Control the number of weirs / holes opened per day. When the reservoir has multiple flood discharge weirs / holes, the fewer the number of opened weirs / holes, the simpler the operation. Therefore, define the "weir / hole number optimization term" as follows: Operation continuity objective f3: Ensure the stability of daily flood discharge operations to reduce frequent opening / closing operations. Introduce an operation continuity optimization term by calculating the change value of the opening / closing state of the weir / hole between the current calculation period and the previous period. wherein, and respectively represent the opening and closing states of the i-th spillway weir at time t and at time t - 1; and respectively represent the opening and closing states of the j-th spillway hole at time t and at time t - 1; Normalize the objective functions of flow matching, operation simplification, and operation continuity in step S2 to obtain The final objective function f of the reservoir flood discharge scheduling model is expressed as the weighted sum of the three normalized objective functions: Among them, ω1, ω2, and ω3 are weight coefficients used to balance the relative importance of flow matching, operation simplification, and operation continuity objectives, and are determined according to the obtained basic information related to flood discharge scheduling. S3. Create a flood discharge operation "label": Based on the optimized flood discharge parameters, associate the reservoir water level, inflow, and flood discharge operations, construct a "label" system for flood discharge operations, and construct a data set. Divide the data set into a calibration period and a verification period. S4. Construct an LSTM model to learn the flood discharge operation rules: During the calibration period, use the reservoir water level and inflow as inputs to train the LSTM model so that it learns the mapping relationship between the flood discharge operation "label" and reservoir scheduling. S5. Simulate the flood discharge scheduling in the verification period: Based on the trained LSTM model, simulate the reservoir flood discharge operations under different reservoir water levels and inflow conditions in the verification period to obtain the optimal flood discharge parameters. S6. Calculate the flood discharge flow: Combine the weir / hole flood discharge flow formula and use the optimal flood discharge parameters obtained in step S5 to calculate the flood discharge flow.
2. The reservoir flood discharge flow simulation calculation method based on the LSTM model according to claim 1, wherein The historical operation characteristic data of the reservoir collected in step S1 is daily-scale data.
3. A method for simulating and calculating reservoir flood discharge flow based on the LSTM model according to claim 1, characterized in that, The constraint conditions in step S2 include water balance constraint, water level constraint, flood discharge capacity constraint, operation sequence constraint, and weir / hole opening constraint: Water balance constraint: V(t + 1) = V(t) + I(t) - O(t) Among them, V(t + 1) and V(t) are the reservoir water storages at times t + 1 and t respectively; I(t) and O(t) are the inflow and outflow at time t. Water level constraint: The flood discharge operation should ensure that the water level is within a reasonable range. H min ≤H≤H max where H min is the elevation of the top of the weir / opening, or the lowest water level at which the discharge opening is opened, Hmax refers to the highest water level that the reservoir is allowed to reach during flood discharge; H refers to the water level of the reservoir during flood discharge; Flood discharge capacity constraint: Avoid excessive flood discharge flow in a short period. Wherein, represents the total discharge at time t, represents the maximum flood discharge allowed at time t; Operation sequence constraint: The operation sequence constraint conforms to the priority of reservoir scheduling. Opening constraint: The opening of the hole should conform to the allowable opening range of the project.
4. A method for simulating and calculating reservoir flood discharge flow based on the LSTM model according to claim 3, characterized in that, The water balance constraint, water level constraint, and discharge capacity constraint are necessary constraint conditions for each reservoir building. Whether the operation sequence constraint and the opening degree constraint are required depends on the basic information related to flood discharge scheduling obtained.
5. A method for simulating and calculating reservoir flood discharge flow based on the LSTM model according to claim 1, characterized in that, The optimization algorithm used to solve the flood discharge parameters in step S2 is the genetic algorithm, which mainly includes the following steps: Initialization: Randomly generate a set of initial solutions for the opening and closing states and opening degrees of the weir / hole as the population; Fitness calculation: Calculate the fitness of each individual according to the objective function. The lower the fitness value, the better the individual. The fitness function is: Among them, f is the final objective function of the reservoir flood discharge scheduling model; Selection: Select individuals to enter the next generation according to the fitness level; Crossover: Perform a crossover operation on the offspring to generate new solutions, and select some variables for exchange; Mutation: Randomly change the opening state or discharge coefficient of a certain hole with a small probability to increase the population diversity; Termination condition: Reach the preset number of generations or convergence criterion, and output the solution with the optimal current fitness.
6. A method for simulating and calculating reservoir flood discharge flow based on the LSTM model according to claim 1, characterized in that, The "labels" of the flood discharge operations in step S3 not only include the opening and closing states of each calculation period of different flood discharge buildings, but also include their opening degree settings. These information together constitute an important feature data set for training the LSTM model. Take 70% of the data set length as the regular period, and the remaining 30% as the verification period.
7. A method for simulating and calculating reservoir flood discharge flow based on the LSTM model according to claim 1, characterized in that, The flood discharge flow formulas for a single weir / hole in step S6 are respectively: Q w = C w · B · H d 3 / 2 Among them, C w and C c are the discharge coefficients of the spillway weir and the discharge orifice respectively, B is the width of the crest of the overflow weir, A is the cross-sectional area of the discharge orifice, H d is the water head above the orifice, Q w and Q c are the flood discharge flows of a single spillway weir and a single discharge orifice in the flood discharge structure respectively.