MATLAB platform and HEC-HMS model coupling method

Through the coupling between the MATLAB platform and the HEC-HMS model, the automatic operation of the model and automatic display of results are achieved, which solves the problems of cumbersome use of the HEC-HMS model and low analysis efficiency, and improves the efficiency and analysis capabilities of hydrological process simulation.

CN119201887APending Publication Date: 2024-12-27CHINA THREE GORGES UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411088231.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The use process of the HEC-HMS model is cumbersome and the calculation results are low in efficiency, which cannot meet scientific research needs. It is necessary to manually copy the calculation results for extended analysis, which reduces the usage efficiency of the model.

Method used

Through the coupling between the MATLAB platform and the HEC-HMS model, the automatic operation and result display of the model is realized, including creating a model database, preparing the required files for automatic operation, establishing an interface with HEC-DSSVue software, automatic operation and result export.

Benefits of technology

Without running the HEC-HMS model software interface, the automatic operation of the HEC-HMS model and automatic reading and display of the results are realized, improving the model's usage efficiency and analysis capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201887A_ABST
    Figure CN119201887A_ABST
Patent Text Reader

Abstract

The invention provides a method for coupling an MATLAB platform and an HEC-HMS model, and belongs to the field of hydrological forecasting, and the method comprises the steps: obtaining hydrometeorological data such as a rainfall process and a runoff process of session flood, writing the obtained data into HEC-DSSVue software, and constructing a database of the HEC-HMS model; preparing a drainage basin file, a model operation file and a meteorological file required for the operation of the HEC-HMS model; compiling a running script of the HEC-HMS model, and setting the name of an engineering project to be run and the flood session of the running; establishing an interface between the MATLAB and the HEC-HMS model, and operating the HEC-HMS model on the MATLAB platform; and establishing an interface of MATLAB and HEC-DSSVue software, reading a calculation result of the HEC-HMS model, and outputting the calculation result in an EXCEL format. According to the method, coupling of the HEC-HMS model and the MATLAB platform is achieved, by establishing interfaces of the MATLAB, the HEC-HMS model and the HEC-DSSVue model, limitation of the HEC-HMS model is broken through, calculation and analysis tools of the HEC-HMS model are enriched, various algorithms and calculation tools on the MATLAB platform can be directly applied to the model, and the calculation capacity of the HEC-HMS model is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of hydrological forecasting, and particularly relates to a method for coupling a MATLAB platform with a HEC-HMS model. Background Art

[0002] At present, in order to study issues such as reservoir scheduling and water resources management, rainfall runoff simulation is one of the essential steps. The widely used rainfall runoff simulation method is to use hydrological models for modeling research. The HEC-HMS model is a hydrological process simulation software developed and continuously updated by the U.S. Army Corps of Engineers. The model has strong applicability and can simulate watershed or urban floods at different time and space scales; the model also has good flexibility and can use different runoff methods to simulate the watershed; at the same time, the model also has the characteristics of friendly interface, simple operation, free use, good simulation effect, etc., and is widely used by scholars.

[0003] However, as a well-developed interface model, the HEC-HMS model requires users to follow its usage process step by step and operate manually, which is cumbersome and time-consuming. Moreover, its calculation result analysis often cannot meet the needs of scientific research. If you want to conduct further extended analysis, you must manually copy the calculation results to an EXCEL table and then analyze them through EXCEL or other tools, which greatly reduces the efficiency of using the HEC-HMS model. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method for coupling a MATLAB platform with a HEC-HMS model. Without running the HEC-HMS model software interface, the automatic operation of the HEC-HMS model can be realized on the MATLAB platform, and the operation result of the model can be automatically read and displayed by the MATLAB software.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for coupling a MATLAB platform with a HEC-HMS model, comprising the following steps: S1. Create HEC-HMS model database; S2, preparing the files required for the automatic operation of the HEC-HMS model on the MATLAB platform; S3, establish the interface between MATLAB platform and HEC-HMS model; S4. Establish the interface between MATLAB platform and HEC-DSSVue software; S5. HEC-HMS model automatically runs and displays the results on the MATLAB platform.

[0006] In the preferred scheme, in step S1, the precipitation excerpt data of the rain gauge stations in the study basin and the flood element excerpt data of each hydrological station in the basin are collected, and the collected data are input into the HEC-DSSVue software in the format of basin, station name, time and variable. The data with unequal time intervals are processed into data with equal time intervals through the time series function, and saved in dss format as the database of the HEC-HMS model.

[0007] In a preferred embodiment, in step S2, the files required for automatically running the HEC-HMS model on the MATLAB platform are prepared, including: 1) Preparation of HEC-HMS watershed files: Determine the methods used for flow generation calculation, confluence calculation and river flood routing of each sub-basin, and set the initial values ​​of the hydrological state variables and the initial values ​​of each parameter used in each method; Prepare the initial watershed file in HEC-HMS software. The initial watershed file includes the coordinate information of each sub-basin, the area information of the sub-basin, the methods used for the calculation of runoff and confluence of each sub-basin and the corresponding parameter values, and the methods used for river flood routing and the corresponding parameter values; 2) Preparation of HEC-HMS control documents: Determine the start time, end time and time interval of each flood, write them into the control file of HEC-HMS, and prepare the control file of HEC-HMS; 3) Preparation of HEC-HMS flood operation documents: Determine the watershed model used for the flood operation, the method used for calculating the surface rainfall in the watershed, and the control file for controlling the flood operation time, and write them into the operation file of HEC-HMS to construct the HEC-HMS flood operation file; 4) Preparation of HEC-HMS model meteorological files: Determine the method used to calculate the basin surface rainfall and the corresponding parameters of the method, and write them into the HEC-HMS meteorological file to prepare the meteorological file; 5) Preparation of HEC-HMS model files: Determine the HEC-HMS project name, database file name, basin surface rainfall calculation method, basin file name, and control file name, and write them into the HEC-HMS model file to prepare the model file; 6) Preparation of HEC-HMS model site files: Determine the rainfall stations required for flood calculations in the basin, as well as the location of the rainfall station's database, data type, source, and unit information, and write them into the HEC-HMS site file to prepare the site file.

[0008] In a preferred embodiment, in step S2, the files required for the automatic operation of the HEC-HMS model on the MATLAB platform are edited and prepared using a text editor.

[0009] In the preferred solution, in step S3, the method for establishing the interface between the MATLAB platform and the HEC-HMS model is: creating a MATLAB running script, the function of the MATLAB running script is to import all functions and classes from the Jython module of the HEC-HMS model, open the specified HEC-HMS project, run a flood of a certain time, and exit the program.

[0010] In a preferred solution, the MATLAB operation script is created and executed on the MATLAB platform to realize the automatic operation of the HEC-HMS model on the MATLAB platform.

[0011] In the preferred scheme, in step S4, the method for establishing the interface between the MATLAB platform and the HEC-DSSVue software is: creating an operation script for the HEC-DSSVue software, the function of the operation script of the HEC-DSSVue software is to read the operation results of the HEC-HMS model, and output the measured flow series, simulated flow series and corresponding time series of the basin outlet section in the operation results to an EXCEL table.

[0012] In a preferred solution, the operation script of the HEC-DSSVue software is run in MATLAB, and the automatic operation of HEC-DSSVue on the MATLAB platform enables MATLAB to automatically read the calculation results of the HEC-HMS model in step S3.

[0013] In the preferred solution, in step S5, the measured flow series, simulated flow series and corresponding time series in EXCEL format exported in step S4 are read on the MATLAB platform, and the simulation accuracy indicators, including the coefficient of certainty, the relative error of the flood peak and flood volume, and the peak time error, are calculated, and the flow process curve is drawn, and the automatic operation results of the HEC-HMS model on the MATLAB platform are compared and analyzed.

[0014] The present invention provides a method for coupling a MATLAB platform with a HEC-HMS model, establishes an interface between the MATLAB platform, the HEC-HMS model and the HEC-DSSVue software, and directly prepares files required by the HEC-HMS model through a text editor. Without running the HEC-HMS model software interface, the automatic operation of the HEC-HMS model can be realized on the MATLAB platform, and the operation result of the model can be automatically read and displayed through the MATLAB software. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The present invention will be further described below in conjunction with the accompanying drawings and embodiments: Figure 1 It is a Dapoling watershed map in an embodiment of the present invention; Figure 2 It is a schematic diagram of the process of coupling the MATLAB platform and the HEC-HMS model in the present invention; Figure 3 This is a schematic diagram showing the results of the automatic operation of the HEC-HMS model in the present invention on the MATLAB platform; Figure 4 Take a screenshot of the parameter settings for a sub-basin in the basin file; Figure 5 Take a screenshot of the parameter settings for a river section in the watershed file; Figure 6 It is the control file of HEC-HMS model; Figure 7 It is the running file of the model; Figure 8 Parameter settings for a sub-basin in the meteorological file; Fig. 9 The model file prepared; Fig.10 is the information of a rainfall station; Fig.11 Run the script for MATLAB; Fig.12 A screenshot of the program that executes the MATLAB run script on the MATLAB platform; Fig.13 Run scripts for the HEC-DSSVue software; Fig.14 Screenshot of the program running the HEC-DSSVue software running script on the MATLAB platform; Fig.15 The calculation indicator results are displayed on the MATLAB platform. DETAILED DESCRIPTION

[0016] Combination Figure 1 to Figure 15The specific embodiments of the present invention are described in further detail.

[0017] This implementation takes the application of the HEC-HMS model in the watershed above the Dapoling hydrological station in the upper reaches of the Huaihe River as an example to demonstrate the effect achieved by the present invention.

[0018] Reference Figure 1 Dapoling Station is the uppermost hydrological station of the Huaihe River mainstream, controlling a basin area of ​​1,640 square kilometers. The river above Dapoling is 73 kilometers long, and the basin is mostly mountainous and hilly with good vegetation. The river is a mountain stream river with many tributaries, a large slope, fast confluence, rapid water flow, and easy to dry up during drought. There are not many water conservancy projects in the basin, and rice is the main crop. There are 4 hydrological stations in the basin above Dapoling. The embodiment is based on the rainfall excerpts of 4 rainfall stations from 18:00 on June 1, 2000 to 8:00 on June 21, 2000, and the flood element excerpts of Dapoling Station, and a script is written on the MATLAB platform to realize the automatic operation of the HEC-HMS model on the MATLAB platform.

[0019] The method of coupling the MATLAB platform with the HEC-HMS model in this embodiment includes the following steps: Step 1: Creation of HEC-HMS model database The precipitation excerpt data of rain gauges in the study basin and the flood element excerpt data of each hydrological station in the basin were collected, and these data were input into the HEC-DSSVue software in the format of basin, station name, time and variable. The data with unequal time intervals were processed into data with equal time intervals through the time series function, and saved in .dss format as the database of the HEC-HMS model.

[0020] The data composition of the constructed database is shown in the following table.

[0021] Table 1 Data composition of the HEC-HMS model database

[0022] Step 2: Preparation of files required for automatic operation of HEC-HMS model on MATLAB platform When preparing the files required for the HEC-HMS model, they are independent of the model and are edited and produced using a text editor.

[0023] 1) Preparation of HEC-HMS watershed files Determine the methods used for runoff calculation, confluence calculation and river flood routing in each sub-basin, and set the initial values ​​of the hydrological state variables and the initial values ​​of each parameter used in each method.

[0024] The initial watershed file is prepared in the HEC-HMS software. The initial watershed file includes the coordinate information of each sub-basin, the area information of the sub-basin, the methods used for the flow generation and confluence calculations of each sub-basin and the corresponding parameter values, and the methods used for river flood routing and the corresponding parameter values.

[0025] In this embodiment, the initial constant rate method is used to determine the flow generation calculation of the sub-basin, the Snyder unit line method is used to calculate the surface runoff, the receding base flow method is used to calculate the underground runoff, and the Muskingum method is used to calculate the river flood.

[0026] Figure 4 and Figure 5 Take a cross-sectional screenshot of the parameter settings for a sub-basin and a river section in the basin file.

[0027] 2) Preparation of HEC-HMS model control files Determine the start time, end time and time interval of each flood, write them into the control file of HEC-HMS, and prepare the control file of HEC-HMS.

[0028] In this embodiment, the starting time of the flood No. 20000603 is determined to be from 18:00 on June 1, 2000 to 8:00 on June 21, 2000, with a time interval of 1 hour, which is written into the control file (.comtrol file) of the HEC-HMS model. The prepared control file is as follows: Figure 6 shown.

[0029] 3) Preparation of HEC-HMS flood operation documents Determine the watershed model used for the flood operation, the method used to calculate the surface rainfall in the watershed, and the control file that controls the operation time of the flood, and write them into the operation file of HEC-HMS to construct the HEC-HMS flood operation file.

[0030] In this embodiment, the basin model used for the 20000603 flood operation is Basin20000603, the method used for calculating the basin surface rainfall is the Thiessen polygon method, and the control file for controlling the operation time of this flood is 20000603.control. It is written into the HEC-HMS operation file (.run file). The model operation file is as follows Figure 7 shown.

[0031] 4) Preparation of HEC-HMS model meteorological files Determine the method used to calculate the basin surface rainfall and the corresponding parameters of the method, and write them into the HEC-HMS meteorological file to prepare the meteorological file.

[0032] In this embodiment, the method used to determine the calculation of basin surface rainfall is the Thiessen polygon method, and the weights of each rainfall station in each sub-basin in this method are written into the HEC-HMS meteorological file to prepare the meteorological file. The parameters of a sub-basin in the meteorological file are as follows: Figure 8 shown.

[0033] 5) Preparation of HEC-HMS model files Determine the HEC-HMS project name, the database file name, the calculation method used for basin surface rainfall, the basin file name, and the control file name, and write them into the HEC-HMS model file to prepare the model file.

[0034] In this embodiment, the project to which the 20000603 flood belongs is named DaPoLing_UTM, the name of the stored database file is DaPoLing_UTM.dss, the calculation method used for the designated basin surface rainfall is the Thiessen polygon method, and the corresponding parameter information is shown in the meteorological file, the name of the designated basin file, and the name of the control file, and is written into the HEC-HMS model file. The prepared model file is as follows: Fig. 9 shown.

[0035] 6) Preparation of HEC-HMS model site files Determine the rainfall stations required for flood calculations in the basin, as well as the location of the rainfall station's database, data type, source, and unit information, and write them into the HEC-HMS site file to prepare the site file.

[0036] In this embodiment, there are 5 rainfall stations and the location of the database of the rainfall stations. The station names of these rainfall stations and the type, source, unit and other information of their data are written into the HEC-HMS site file (.gage file) to prepare the site file. Fig.10 shown.

[0037] Step 3: Establish the interface between MATLAB platform and HEC-HMS model Create a MATLAB run script. The function of the MATLAB run script is to import all functions and classes from the Jython module of the HEC-HMS model, open the specified HEC-HMS project, run a flood event, and exit the program.

[0038] The MATLAB running script established in this embodiment is as follows Fig.11 shown.

[0039] The program to execute the above script on the MATLAB platform is as follows Fig.12 shown.

[0040] Step 4: Establish the interface between MATLAB platform and HEC-DSSVue software The method to establish the interface between the MATLAB platform and the HEC-DSSVue software is to create a running script for the HEC-DSSVue software. The function of the running script of the HEC-DSSVue software is to read the running results of the HEC-HMS model and output the measured flow series, simulated flow series and corresponding time series of the basin outlet section in the running results to the EXCEL table.

[0041] The HEC-DSSVue software running script created in this embodiment is as follows Fig.13 shown.

[0042] The program to run the above script in MATLAB is as follows Fig.14 shown.

[0043] Step 5: HEC-HMS model automatically runs and displays results on the MATLAB platform The measured flow series, simulated flow series and corresponding time series in EXCEL format exported in step S4 are read on the MATLAB platform, and the simulation accuracy indicators, including the coefficient of certainty, relative error of flood peak and flood volume, and peak time error, are calculated. The flow process curve is drawn, and the automatic running results of the HEC-HMS model on the MATLAB platform are compared and analyzed.

[0044] The calculation index results displayed on the MATLAB platform are as follows Fig.15 The flow process curve is shown in the attached Figure 3 .

[0045] From the above embodiments, it can be seen that the present method realizes the coupling between the HEC-HMS model and the MATLAB platform. Without running the HEC-HMS model software interface, the automatic operation of the HEC-HMS model can be realized on the MATLAB platform, and the operation results of the model can be automatically read and displayed by the MATLAB software.

Claims

1. A method for coupling a MATLAB platform with a HEC-HMS model, characterized in that: The following steps are involved: S1. Create HEC-HMS model database; S2, preparing the files required for the automatic operation of the HEC-HMS model on the MATLAB platform; S3, establish the interface between MATLAB platform and HEC-HMS model; S4. Establish the interface between MATLAB platform and HEC-DSSVue software; S5. HEC-HMS model automatically runs and displays the results on the MATLAB platform.

2. The method for coupling a MATLAB platform with a HEC-HMS model according to claim 1, characterized in that: In the step S1, the precipitation excerpt data of the rain gauge stations in the study basin and the flood element excerpt data of each hydrological station in the basin are collected, and the collected data are input into the HEC-DSSVue software in the format of basin, station name, time and variable. The data with unequal time intervals are processed into data with equal time intervals through the time series function, and saved in dss format as the database of the HEC-HMS model.

3. The method for coupling a MATLAB platform with a HEC-HMS model according to claim 1, characterized in that: In step S2, the files required for the automatic operation of the HEC-HMS model on the MATLAB platform are prepared, including: 1) Preparation of HEC-HMS watershed files: Determine the methods used for flow generation calculation, confluence calculation and river flood routing of each sub-basin, and set the initial values ​​of the hydrological state variables and the initial values ​​of each parameter used in each method; Prepare the initial watershed file in HEC-HMS software. The initial watershed file includes the coordinate information of each sub-basin, the area information of the sub-basin, the methods used for the calculation of runoff and confluence of each sub-basin and the corresponding parameter values, and the methods used for river flood routing and the corresponding parameter values; 2) Preparation of HEC-HMS control documents: Determine the start time, end time and time interval of each flood, write them into the control file of HEC-HMS, and prepare the control file of HEC-HMS; 3) Preparation of HEC-HMS flood operation documents: Determine the watershed model used for the flood operation, the method used for calculating the surface rainfall in the watershed, and the control file for controlling the flood operation time, and write them into the operation file of HEC-HMS to construct the HEC-HMS flood operation file; 4) Preparation of HEC-HMS model meteorological files: Determine the method used to calculate the basin surface rainfall and the corresponding parameters of the method, and write them into the HEC-HMS meteorological file to prepare the meteorological file; 5) Preparation of HEC-HMS model files: Determine the HEC-HMS project name, database file name, basin surface rainfall calculation method, basin file name, and control file name, and write them into the HEC-HMS model file to prepare the model file; 6) Preparation of HEC-HMS model site files: Determine the rainfall stations required for flood calculations in the basin, as well as the location of the rainfall station's database, data type, source, and unit information, and write them into the HEC-HMS site file to prepare the site file.

4. The method for coupling a MATLAB platform with a HEC-HMS model according to claim 1, characterized in that: In the step S2, the files required for the automatic operation of the HEC-HMS model on the MATLAB platform are edited and prepared by a text editor.

5. The method for coupling a MATLAB platform with a HEC-HMS model according to claim 1, characterized in that: In step S3, the method for establishing the interface between the MATLAB platform and the HEC-HMS model is: creating a MATLAB running script, the function of the MATLAB running script is to import all functions and classes from the Jython module of the HEC-HMS model, open the specified HEC-HMS project, run a flood of a certain time, and exit the program.

6. The method for coupling a MATLAB platform with a HEC-HMS model according to claim 5, characterized in that: The created MATLAB running script is executed on the MATLAB platform to realize the automatic running of the HEC-HMS model on the MATLAB platform.

7. The method for coupling a MATLAB platform with a HEC-HMS model according to claim 1, characterized in that: In step S4, the method for establishing the interface between the MATLAB platform and the HEC-DSSVue software is: creating an operation script for the HEC-DSSVue software, the function of the operation script of the HEC-DSSVue software is to read the operation results of the HEC-HMS model, and output the measured flow series, simulated flow series and corresponding time series of the basin outlet section in the operation results to an EXCEL table.

8. The method for coupling a MATLAB platform with a HEC-HMS model according to claim 7, characterized in that: The operation script of the HEC-DSSVue software is run in MATLAB. The automatic operation of HEC-DSSVue on the MATLAB platform enables MATLAB to automatically read the calculation results of the HEC-HMS model in step S3.

9. The method for coupling a MATLAB platform with a HEC-HMS model according to claim 1, characterized in that: In step S5, the measured flow series, simulated flow series and corresponding time series in EXCEL format exported in step S4 are read on the MATLAB platform, and simulation accuracy indicators, including the coefficient of certainty, relative errors of flood peak and flood volume, and peak time error, are calculated, and the flow process curve is drawn, and the automatic operation results of the HEC-HMS model on the MATLAB platform are compared and analyzed.