Physical-constrained differentiable graph neural network for river network distributed manning coefficient inversion
Patent Information
- Application Number
- CN202610733056.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]本发明的目的在于提供物理约束的可微图神经网络河网分布式曼宁系数反演方法,能够结合河网拓扑结构特征与水动力学物理规律,在保证物理一致性的前提下,实现对多河段、多分支、复杂连通河网中曼宁系数的高效、稳定和精细化反演,以克服现有技术存在的计算成本高、依赖经验强、物理约束不足及复杂河网适应性差等问题
(1)融合河网拓扑关联特征与水动力作用机理,实现参数反演一体化建模,适配复杂河网的空间结构特性;
Smart Images

Figure CN122595897A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hydrological simulation, and more particularly to a physically constrained method for inverting the Manning coefficient in a distributed manner using a differentiable graphical neural network for river networks. Background Technology
[0002] The Manning coefficient is a core parameter characterizing the roughness of river boundaries and the resistance to flow. It is a key variable in hydrodynamic models for regulating the propagation of water level, flow rate, and velocity, directly determining the reliability and accuracy of engineering simulations such as river network flood evolution, water resource allocation, urban flooding analysis, and digital twin watershed construction. In complex river network scenarios, high-precision, rapid, and robust Manning coefficient inversion is a crucial problem that urgently needs to be solved in the field of hydrodynamic parameter identification.
[0003] Existing methods for obtaining Manning coefficients suffer from significant bottlenecks: empirical assignment methods rely on expert experience, failing to adapt to the spatial heterogeneity of roughness in complex river networks and resulting in weak model generalization capabilities; prototype observation calibration data is costly and has poor applicability in small and medium-sized rivers, areas with dense tributaries, and regions with scarce data. Traditional optimization algorithms (genetic algorithms, particle swarm optimization, etc.) require repeated calls to hydrodynamic models, incurring high computational costs and failing to utilize river network topological correlation information, leading to low efficiency. Purely data-driven deep learning methods lack physical constraints, easily violating the laws of flow conservation, and exhibiting insufficient stability and interpretability. Existing graph neural networks primarily focus on hydrodynamic state prediction, rarely addressing Manning coefficient inversion, and are not deeply coupled with hydrodynamic equations, lacking a unified differentiable solution framework.
[0004] In summary, existing technologies suffer from drawbacks such as reliance on experience, computational inefficiency, insufficient physical consistency, lack of utilization of topological information, and unstable inversion results. There is an urgent need to construct a new method for Manning coefficient inversion that balances accuracy, efficiency, physical rationality, and topological adaptability. Summary of the Invention
[0005] The purpose of this invention is to provide a physically constrained, differentiable graph neural network-based distributed Manning coefficient inversion method for river networks. This method combines the topological characteristics of river networks with the physical laws of hydrodynamics, and achieves efficient, stable, and refined inversion of Manning coefficients in multi-segment, multi-branch, and complex connected river networks while ensuring physical consistency. This overcomes the problems of high computational cost, strong reliance on experience, insufficient physical constraints, and poor adaptability to complex river networks in existing technologies.
[0006] To achieve the above objectives, this invention provides a physically constrained method for inverting the distributed Manning coefficients of differentiable graph neural networks in river networks, comprising the following steps: S1. Obtain basic river network data, organize the basic river network data into river network topology information and construct the river network graph structure, and extract node features, edge features and boundary spatiotemporal sequences; S2. Based on river network topology information, node characteristics, edge characteristics and boundary spatiotemporal sequences, a graph neural network is used to output the Manning coefficient inversion value for each river segment; S3. Construct a differentiable river network hydrodynamic control model, substitute the Manning coefficient inversion value into the differentiable river network hydrodynamic control model, and simulate the river network hydrodynamic process. S4. Construct a joint loss function that includes physical constraints and calculate the total loss value; S5. Based on the automatic differentiation mechanism, end-to-end gradient optimization is performed with the goal of minimizing the joint loss function, and the results of the distributed Manning coefficient inversion of the river network are output.
[0007] Preferably, S1 specifically includes: S11. Obtain basic river network data, including river network geographic information, water system topology, river channel cross-sectional parameters, riverbed slope, boundary conditions, and observation data; The target river network is represented as a graph structure consisting of nodes and river segments, where nodes represent boundary sections, confluence points and monitoring points, and river segments represent hydraulic connectivity. The graph structure is represented as a directed graph, and the formula is: ; in, A directed graph representing the topology of the target river network. This is a set of nodes used to represent river cross-section nodes, boundary nodes, intersection nodes, and control nodes in a river network. This is a set of edges used to represent river segments and their upstream and downstream connectivity; S12, for nodes Assigning node features For each side Assigning edge features ,in, , ; Node characteristics include: node type, boundary type, measured water level, measured flow rate, water surface width, bottom elevation, geographic coordinates, and hydrological time series state quantities; Edge features include: river segment length, riverbed slope, cross-sectional area function, wetted perimeter function, river width function, riverbed material type, vegetation cover information, and roughness prior value; S13, For any river segment Establish the correspondence between cross-sectional parameters and water surface elevation using the following formula: ; ; ; in, The cross-sectional area of the water passage. For wet period, For hydraulic radius, This refers to the water surface elevation. The geometric relationship of the river section cross-section is given by the measured cross-section, standard cross-section parameters, interpolation function or cross-section parameterization model; S14. Extract the water level and flow time series data of each inlet and outlet boundary section from the boundary conditions of the river network basic data to form the boundary spatiotemporal sequence.
[0008] Preferably, S2 specifically includes: The river network topology information, node features, edge features, and spatiotemporal sequences of hydrological boundaries are input into a graph neural network. Through a multi-layer message passing mechanism combined with feature aggregation, the spatial correlation and upstream-downstream coupling between river segments are explored, and the Manning coefficient inversion value corresponding to each river segment is output.
[0009] Preferably, the multi-layer message passing mechanism in S2 specifically includes: In the During the message passing process in a layered graph, the update of a node's hidden state is represented as follows: ; ; in, For nodes No. Layered aggregation messages, Represents nodes The set of adjacent nodes, Represents the message function, Represents a node In the Hidden representation of layers, Adjacent nodes In the Hidden representation of layers, For edge feature vectors, For nodes After the update Layer hidden representation, For the first Layer state update function; For the parameter inversion of the edge-level river segment, the hidden edge state is constructed using the following formula: ; in, Let e be the hidden state of the edge corresponding to river segment e. For edge feature fusion function, This represents the hidden state of the node after being passed through layer L from the upstream node. For downstream nodes Hidden state of nodes after layer propagation. River section The corresponding edge features.
[0010] Preferably, when outputting the Manning coefficient inversion values for each river segment in S2, the Manning coefficient inversion values are constrained within a physically reasonable range using a bounded activation function. The constraint formula is as follows: ; in, River section The Manning coefficient inversion value, and These are the lower and upper bounds of the physically reasonable range for the Manning coefficient, respectively. It is a bounded activation function. These are the weight parameters for the output layer of a graph neural network. These are the bias parameters for the output layer of the graph neural network.
[0011] Preferably, the construction of a differentiable river network hydrodynamic control model in S3 specifically includes: A differentiable hydrodynamic solver is constructed based on the Saint-Venant equations, which include the continuity equation and the momentum equation and embed the Manning drag relation. The formula for the continuity equation is: ; in, For time, For the spatial coordinates of the river section, , For the flow rate of the river section, The lateral inflow or outflow per unit length of the river section; The momentum equation is as follows: ; in, This is the momentum correction factor. It is the acceleration due to gravity. For frictional gradient, This represents the component of the lateral incoming flow velocity in the mainstream direction; The Manning resistance relationship formula is: ; in, River section The Manning coefficient inversion value.
[0012] Preferably, when simulating the hydrodynamic process of the river network in S3, coupling conditions, initial simulation conditions, and boundary conditions are set for the confluence nodes of the river network. The node coupling conditions include flow conservation conditions and water level continuity conditions. The formula for the flow conservation condition is: ; in, For inflow node The collection of river sections, outflow node The collection of river sections, This refers to the amount of water added or taken out at the node over time. River section length, For a moment reach Downstream traffic Let t be the flow rate at the upstream end of river segment e at time t; Under conditions of no local energy loss, the water level continuity condition is met at the confluence node: ; in, Indicates the location where the river section connects to the node. For a moment Corresponding node At the water level, , For a moment Connecting nodes Water levels at the junctions of different river sections; When considering local flow losses, the energy continuity relation with local loss terms is used: ; in, The local loss coefficient of the node. For node features, water flow area For nodes Total flow at the location and They are time intervals Inflow and outflow nodes The water level at the junction of any section of the river; The simulation operation involves setting up initial and boundary conditions, specifically as follows: Set initial conditions for each river segment: ; ; in, and Let $x$ be the flow rate and water level of river segment $e$ at location $x$ at the initial moment. and Let be the initial flow rate and initial water level distribution functions for river segment e, respectively; The upstream boundary adopts a given flow boundary: ; in, For a moment reach Upstream inflow; The downstream boundary adopts a given water level boundary: ; in, For a moment reach Downstream water level, For a moment reach The downstream outflow water level; For general boundary conditions, a unified form is adopted: ; in, This is a boundary control function, adaptable to water level boundaries, flow boundaries, water level-flow relationship boundaries, or dam scheduling boundaries. For a moment reach The boundary control function values corresponding to the flow rate and water level.
[0013] Preferably, the joint loss function containing physical constraints is constructed in S4 as follows: By combining the river network hydrodynamic simulation results of S3 with the observation data of S1, a joint loss function is constructed; Joint loss function The expression is: ; in, These are the weighting coefficients for each loss term. This is the observation fitting term, used to fit simulated values to observed data. These are continuity constraint terms used to constrain errors in the hydrodynamic continuity equations. This is a momentum constraint term used to constrain errors in the hydrodynamic momentum equations. These are the node intersection constraints, used to ensure that the river network intersection nodes satisfy the relationships of flow conservation and water level continuity. This is a boundary consistency term used to ensure that the hydrological conditions at the river network inlet and outlet boundaries are consistent with the actual operating conditions. This is a spatial smoothing constraint term used to constrain the spatial distribution continuity of the Manning coefficient between adjacent river segments. This is a rough a priori regularization term used to constrain the reasonableness of the Manning coefficient values.
[0014] Preferably, the end-to-end gradient optimization in S5 includes an iterative update process, the steps of which are as follows: S51. The graph neural network is forward propagated to output the Manning coefficient inversion value for each river segment; S52. Substitute the Manning coefficient inversion value into the differentiable river network hydrodynamic control model constructed in S3 to calculate the time series water level and flow simulation values; S53. Substitute the simulated values and observed data into the joint loss function constructed in S4 to calculate the total loss value; S54. Based on the automatic differentiation mechanism, backpropagate to calculate the gradient of the loss function with respect to the parameters of the graph neural network; S55. Update the graph neural network parameters using a gradient-based optimization algorithm; S56. Repeat steps S51 to S55 until the loss function converges or the preset number of iterations is reached, and output the final river network distributed Manning coefficient inversion result.
[0015] Preferably, in S54, when calculating the gradient through backpropagation based on the automatic differentiation mechanism, the joint loss function is made relative to the graph neural network parameters by relying on the automatic differentiation mechanism. With river section Manning coefficient inversion value Guideable, river section Manning coefficient inversion value The parameter mapping is accomplished using a graph neural network, expressed as: ; in, Graph neural network parameters For graph neural network mapping functions with learnable parameters, This is a diagram of the river network topology. For the set of node features, For the set of edge features, It is a set of boundary conditions and observation information; By constructing the gradient propagation relationship using the chain rule, accurate gradient calculation in S54 is achieved. The gradient propagation formula is as follows: ; in, This is the joint total loss function defined in S4, which includes multi-dimensional physical constraints. The solution is obtained automatically through backpropagation by a differentiable hydrodynamic solver, avoiding the repeated trial and error operations of traditional optimization methods and ensuring the efficient updating of the S55 gradient-type optimization algorithm. After the loss function in S56 meets the convergence condition or reaches the preset number of iterations, the Manning coefficient results for all river segments of the target river network are output. In addition, it synchronously outputs the hydrodynamic state variables of the entire river network calculated based on the inversion results, including water level processes. Flow process and flow rate process ,and ,in, It is an ordered sequence of Manning coefficient values corresponding to each river segment within the river network.
[0016] Therefore, the present invention employs the above-mentioned physically constrained differentiable graph neural network distributed Manning coefficient inversion method for river networks, which has the following beneficial effects: (1) Integrating the topological correlation characteristics of river networks with the hydrodynamic mechanism, we can realize integrated modeling of parameter inversion and adapt to the spatial structural characteristics of complex river networks; (2) Construct an efficient gradient-driven parameter inversion mechanism to significantly reduce computational overhead and greatly improve the efficiency and convergence of parameter inversion in complex river networks; (3) Strengthen the deep integration of physical constraints and parameter inversion, effectively avoid non-physical interpretation, and significantly improve the physical consistency and reliability of the inversion results; (4) Enhance the stability of parameter inversion under complex working conditions, ensure smooth and reasonable spatial distribution of parameters, and adapt to the engineering application needs of large-scale, multi-branch river networks.
[0017] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the overall process of the physically constrained differentiable graph neural network river network distributed Manning coefficient inversion method of the present invention; Figure 2 This is a schematic diagram of the topology of a river network design example in an embodiment of the present invention; Figure 3 This is a schematic diagram showing the boundary conditions, internal observation sections, and lateral inflow settings in an embodiment of the present invention. Figure 4 This is a schematic diagram of the graph structure representation obtained by abstracting the river network physical system in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the coupling relationship between the graph neural network Manning coefficient inversion module and the differentiable hydrodynamics solution module in an embodiment of the present invention. Figure 6 This is a schematic diagram comparing the reference distribution and the inversion distribution of the Manning coefficient in a river segment in an embodiment of the present invention; Figure 7 This is a schematic diagram comparing the simulation results of the method of the present invention and the traditional calibration method in an embodiment of the present invention. Detailed Implementation
[0019] Example like Figure 1 As shown, this embodiment discloses a physically constrained distributed Manning coefficient inversion method for differentiable graph neural networks in river networks, the steps of which include: S1. Obtain basic river network data, organize the basic river network data into river network topology information and construct the river network graph structure, and extract node features, edge features and boundary spatiotemporal sequences.
[0020] like Figure 2 As shown, a planar multi-level river network system was constructed. This network comprises one main stream, two first-order tributaries, and two second-order tributaries, totaling 24 river segments and 25 nodes. The main stream consists of eight continuous river segments, flowing from west to east. One first-order tributary flows into the main stream from the north and one from the south. The two second-order tributaries flow into their respective first-order tributaries. The network includes five upstream inflow boundaries, one downstream water level boundary, and five internal observation sections. Lateral inflow is also established in some sections of the middle reaches to simulate rainfall runoff, irrigation runoff, and urban drainage.
[0021] To enhance the physical realism of the case study, this embodiment sets cross-sectional geometric parameters according to river class and zone. The design depth of the main stream is 4.5m, and the river width is 700m–1400m; the design depth of the first-order tributary on the north side is 3.3m–5.0m, and the river width is 170m–220m; the design depth of the second-order tributary on the north side is 1.6m, and the river width is 20m–50m; the design depth of the first-order tributary on the south side is 2.5m, and the river width is 160m–310m; the design depth of the second-order tributary on the south side is 1.0m, and the river width is 80m–150m. The main stream preferably adopts a double trapezoidal cross section, the first-order tributaries adopt trapezoidal or narrow-shoal double trapezoidal cross sections, and the second-order tributaries adopt trapezoidal cross sections. The second-order tributary on the south side can adopt a wide, shallow, and gently sloping cross section to characterize the geometric features of the plain drainage canal. The length of each river segment is set to 0.8km–6.5km. The riverbed slope is divided into zones according to grade: 0.00005–0.00012 for the main stream, 0.00008–0.00018 for the first-level tributary on the north side, 0.00006–0.00020 for the first-level tributary on the south side, 0.00015–0.00040 for the second-level tributary on the north side, and 0.00010–0.00025 for the second-level tributary on the south side.
[0022] To verify the Manning coefficient inversion capability of this invention, a set of reference Manning coefficients was pre-assigned as design true values for each river segment. The reference Manning coefficients for the main stream were set to 0.022–0.030, for the first-order tributary on the north side to 0.026–0.034, for the first-order tributary on the south side to 0.028–0.038, for the second-order tributary on the north side to 0.035–0.045, and for the second-order tributary on the south side to 0.030–0.040. These reference Manning coefficients were then substituted into the river network hydrodynamic model for forward calculations to generate water level and flow time series under design conditions, and small-amplitude random disturbances were superimposed as synthetic observation data. Preferably, the water level observation noise was Gaussian noise with a mean of 0 and a standard deviation of 0.02 m, and the flow observation noise was Gaussian noise with a mean of 0 and a standard deviation of 2%–5% of the flow mean.
[0023] In this embodiment, the specific implementation of each of the above steps is as follows: S11. Obtain basic river network data, including river network geographic information, water system topology, river channel cross-sectional parameters, riverbed slope, boundary conditions, and observation data; The target river network is represented as a graph structure consisting of nodes and river segments, where nodes represent boundary sections, confluence points and monitoring points, and river segments represent hydraulic connectivity. like Figure 4 As shown, the graph structure is represented as a directed graph, and the formula is: ; in, A directed graph representing the topology of the target river network. This is a set of nodes used to represent river cross-section nodes, boundary nodes, intersection nodes, and control nodes in a river network. It is a set of edges used to represent river segments and their upstream and downstream connectivity; each edge corresponds to a river segment, and each node records the status of the water level, boundary type, observation information and other information related to that node.
[0024] In this embodiment: If a node is located at the upstream inflow boundary, it is marked as a flow boundary node; If a node is located at the downstream control section, it is marked as a water level boundary node; If a node is where a tributary merges into a main road, then mark it as a confluence node; If a node has a measurement station, it is marked as an observation node.
[0025] The input features of each node may include: node coordinates, node type, boundary identifier, measured water level, measured flow rate, riverbed elevation, and time step index information.
[0026] The input features for each river segment may include: river segment length, bottom slope, bottom width, slope coefficient, cross-sectional area function parameter, wetted perimeter function parameter, adjacent node number, presence of lateral inflow, prior roughness interval, and river category code.
[0027] S12, regarding the first Nodes Assigning node features , for the connection of the The node and the first Directed edges of nodes Assigning edge features ; Node characteristics include: node type, boundary type, measured water level, measured flow rate, water surface width, bottom elevation, geographic coordinates, and hydrological time series state quantities; Edge features include: river segment length, riverbed slope, cross-sectional area function, wetted perimeter function, river width function, riverbed material type, vegetation cover information, and roughness prior values. ; S13, For any river segment Establish the correspondence between cross-sectional parameters and water surface elevation using the following formula: ; ; ; in, The cross-sectional area of the water passage. For wet period, For hydraulic radius, This refers to the water surface elevation. The geometric relationship of the river section cross-section is given by the measured cross-section, standard cross-section parameters, interpolation function or cross-section parameterization model; S14. Extract the water level and flow time series data of each inlet and outlet boundary section from the boundary conditions of the river network basic data to form the boundary spatiotemporal sequence.
[0028] S2. Based on river network topology information, node characteristics, edge characteristics, and boundary spatiotemporal sequences, a graph neural network is used to output the Manning coefficient inversion values for each river segment. Specifically, this includes: The river network topology information, node features, edge features, and spatiotemporal sequences of hydrological boundaries are input into a graph neural network. Through a multi-layer message passing mechanism combined with feature aggregation, the spatial correlation and upstream-downstream coupling between river segments are explored, and the Manning coefficient inversion value corresponding to each river segment is output.
[0029] like Figure 5 As shown, in this embodiment, the graph neural network Manning coefficient inversion module and the differentiable hydrodynamics solution module constitute a coupled inversion framework. The graph neural network is used to learn the mapping relationship between "river network structure - channel properties - roughness parameters" and outputs the edge-level Manning coefficient parameters. The graph neural network mainly includes an input encoding layer, a message passing layer, an edge feature aggregation layer, and a parameter decoding layer.
[0030] First, linear embedding is performed on the node features and edge features respectively to obtain the initial hidden representation: ; ; in, Hide features for the initial node corresponding to node i. For directed edges The corresponding initial edge hidden features, Input features for the nodes, As the edge input features, , , , These are learnable parameters.
[0031] Multi-layered message passing mechanisms specifically include: In the During the message passing process in a layered graph, the update of a node's hidden state is represented as follows: ; ; in, For nodes No. Layered aggregation messages, Represents nodes The set of adjacent nodes, Represents the message function, Represents a node In the Hidden representation of layers, Adjacent nodes In the Hidden representation of layers, For edge feature vectors, For nodes After the update Layer hidden representation, For the first Layer state update function.
[0032] For the parameter inversion of the edge-level river segment, the hidden edge state is constructed using the following formula: ; in, Let e be the hidden state of the edge corresponding to river segment e. For edge feature fusion function, This represents the hidden state of the node after being passed through layer L from the upstream node. For downstream nodes Hidden state of nodes after layer propagation. River section The corresponding edge features.
[0033] When outputting the Manning coefficient inversion values for each river segment, a bounded activation function is used to constrain the Manning coefficient inversion values to a physically reasonable range. The constraint formula is as follows: ; in, River section The Manning coefficient inversion value, and These are the lower and upper bounds of the physically reasonable range for the Manning coefficient, respectively. It is a bounded activation function. These are the weight parameters for the output layer of a graph neural network. This refers to the bias parameters of the output layer of the graph neural network. In this embodiment, the Manning coefficient is preset to a range of 0.015 to 0.060 to ensure the physical plausibility of the inversion results.
[0034] S3. Construct a differentiable river network hydrodynamic control model, specifically including: like Figure 5 As shown, a differentiable hydrodynamic solver is constructed based on the Saint-Venant equations, which include the continuity equation and the momentum equation and embed the Manning drag relation. The formula for the continuity equation is: ; in, For time, For the spatial coordinates of the river section, , For the flow rate of the river section, The lateral inflow or outflow per unit length of the river section; The momentum equation is as follows: ; in, This is the momentum correction factor. It is the acceleration due to gravity. For frictional gradient, This represents the component of the lateral incoming flow velocity in the mainstream direction; The Manning resistance relationship formula is: ; ; in, River section The Manning coefficient inversion value.
[0035] In this embodiment, an implicit time-stepping method is used to discretize the governing equations to improve numerical stability. The preferred time step is 5 minutes, and the simulation duration is set to 72 hours. Each river segment is discretized into several computational units according to its length, so that the preferred spatial step is 100m to 500m.
[0036] To achieve automatic differentiation and gradient propagation, the aforementioned continuous governing equations are discretized and embedded into a differentiable computational graph. Let the time step size be... The space is a walking distance of For the first section of the river The computing unit and the first Construct discrete residuals across time layers: Discrete residuals of continuity equations The formula is: ; in, and River sections The Middle The computing unit in the first , The cross-sectional area of water flow in each time layer and They are respectively the first in section e of the river , The interface is in the first Traffic at each time layer (interlaced grid interface traffic). denoted as the lateral inflow or outflow per unit length of the j-th computational unit in river segment e at the (k+1)-th time level; Momentum equation discrete residual The formula is: ; in, This is the momentum correction factor. and The j-th computational unit in river segment e is in the j-th... Traffic at k time layers and They are respectively the first in section e of the river , The interface is in the first The cross-sectional area of water flow in each time layer; Among them, friction slope The discrete form is: ; in, River section The Middle The computing unit in the first The hydraulic radius of each time layer; By incorporating discrete residuals as differentiable representations into the computational graph, the river segment can be analyzed. Manning coefficient inversion value And automatically differentiate the parameters of the graph neural network.
[0037] The Manning coefficient inversion value is substituted into a differentiable river network hydrodynamic control model to simulate the river network hydrodynamic process. Specifically, coupling conditions, initial simulation conditions, and boundary conditions are set for the river network confluence nodes. The node coupling conditions include flow conservation conditions and water level continuity conditions. like Figure 3 As shown, the formula for the flow conservation condition is: ; in, For inflow node The collection of river sections, outflow node The collection of river sections, This refers to the amount of water added or taken out at the node over time. River section length, For a moment reach Downstream traffic Let t be the flow rate at the upstream end of river segment e at time t; In this embodiment, to ensure water surface continuity at the confluence node and under conditions of no local energy loss, the water level continuity condition is met at the confluence node: ; in, Indicates the location where the river section connects to the node. For a moment Corresponding node At the water level, , The connecting nodes at time t are respectively Water levels at the junctions of different river sections; When considering local flow losses, the energy continuity relation with local loss terms is used: ; in, The local loss coefficient of the node. For node features, water flow area For nodes Total flow at the location and They are time intervals Inflow and outflow nodes The water level at the junction of any section of the river; The simulation operation involves setting up initial and boundary conditions, specifically as follows: Set initial conditions for each river segment: ; ; in, and Let $x$ be the flow rate and water level of river segment $e$ at location $x$ at the initial moment. and Let be the initial flow rate and initial water level distribution functions for river segment e, respectively; The upstream boundary adopts a given flow boundary: ; in, Let be the upstream inflow discharge of river segment e at time t; The downstream boundary adopts a given water level boundary: ; in, Let t be the water level at the downstream end of the river segment e at time t. Let t be the downstream outflow water level of river segment e at time t; For general boundary conditions, a unified form is adopted: ; in, This is a boundary control function, adaptable to water level boundaries, flow boundaries, water level-flow relationship boundaries, or dam scheduling boundaries. Let be the boundary control function value for the river segment e at time t, corresponding to the flow rate and water level.
[0038] In this embodiment, the following boundary conditions are set: The five upstream boundaries adopt the flow boundaries of the given inflow process line; A downstream boundary is defined by a given water level process line. Lateral inflow is present in both middle reaches of the river, and the lateral inflow process is represented by a piecewise linear function; The initial conditions are given by the steady-state water surface line calculation results, serving as the initial water level and initial flow field for the unsteady flow simulation.
[0039] To generate the "observations" required for the inversion, a forward simulation was first performed using the reference Manning coefficient to obtain the design water level and design flow rate processes for each observation section. Then, random noise was superimposed to generate synthetic observation data. Among the five internal observation sections: Three cross-sections provide continuous water level monitoring; The two cross-sections provide simultaneous water level and flow rate monitoring.
[0040] In this way, the inversion accuracy of the present invention can be quantitatively verified given the known true reference value.
[0041] S4. Construct a joint loss function that includes physical constraints and calculate the total loss value. Specifically: By combining the river network hydrodynamic simulation results of S3 with the observation data of S1, a joint loss function is constructed; Joint loss function The expression is: ; in, These are the weighting coefficients for each loss term. This is the observation fitting term, used to fit simulated values to observed data. These are continuity constraint terms used to constrain errors in the hydrodynamic continuity equations. This is a momentum constraint term used to constrain errors in the hydrodynamic momentum equations. These are the node intersection constraints, used to ensure that the river network intersection nodes satisfy the relationships of flow conservation and water level continuity. This is a boundary consistency term used to ensure that the hydrological conditions at the river network inlet and outlet boundaries are consistent with the actual operating conditions. This is a spatial smoothing constraint term used to constrain the spatial distribution continuity of the Manning coefficient between adjacent river segments. This is a rough a priori regularization term used to constrain the reasonableness of the Manning coefficient values.
[0042] The specific expressions for each loss term are as follows: Observational Fitting Term : ; in, Let be the simulated water level value of the i-th water level observation node at time t. Let be the measured water level value at time t for the i-th water level observation node. Let be the simulated flow rate value at time t for the j-th flow observation section. Let be the measured flow rate value at time t for the j-th flow observation section; This refers to the set of observation nodes or control sections with water level observation data and the corresponding observation times. This refers to the set of observation nodes or control sections with flow observation data and their corresponding observation times. and These are the weighting coefficients for water level observation errors and flow rate observation errors, respectively, used to balance the influence of different observation types on the total loss function.
[0043] Residual term of continuity equation : ; in, Discrete residuals for continuous equations; Momentum equation residual term : ; in, The discrete residuals of the momentum equation; Node coupling terms : ; in, It represents any combination of two connected river segments at a node. For nodes A set of paired combinations of connected river sections; Boundary condition constraints : ; in, The set of river segments for setting upstream flow boundaries, The set of river sections for setting downstream water level boundaries. For river segment e at the upstream end Simulated flow rate at point and time t To show the upstream inflow boundary flow of river segment e at a given time t, Let e be the downstream water level boundary value given at time t. River segment e is at the downstream end Simulated water level at point t and time t.
[0044] To avoid non-physical abrupt changes in roughness between adjacent river sections, this embodiment introduces a spatial smoothing term. : ; in, A pair of adjacent rivers, The Manning coefficient inversion value for river segment r. Adjacent river segments refer to combinations of river segments that are directly connected or spatially adjacent in the river network topology. ε is the smoothing weighting coefficient between adjacent river segments é and r, used to control the degree of influence of the roughness difference between the two river segments on the loss function.
[0045] If there is already an existing roughness range based on engineering experience, then a priori constraint terms are introduced. : ; in, River section The prior roughness, represents the prior uncertainty parameter.
[0046] S5. Based on the automatic differentiation mechanism, end-to-end gradient optimization is performed with the goal of minimizing the joint loss function, including an iterative update process. The steps of the iterative update process are as follows: S51. The graph neural network forward propagation inputs the river network structure, boundary conditions, observation data and river segment attributes into the network, and outputs the Manning coefficient inversion value of each river segment. Specifically, it outputs the estimated Manning coefficient values of all 24 river segments. S52. Substitute the above Manning coefficient inversion value (i.e. Manning coefficient estimate) into the differentiable river network hydrodynamic control model (i.e., the differentiable hydrodynamic solver) constructed in S3 to calculate the time series water level and flow simulation values, and specifically deduce the evolution process of water level and flow in each river section within 72 hours. S53. Substitute the hydrodynamic simulation values and observation data from the previous 72 hours into the joint loss function constructed in S4 to calculate the total loss value; S54. Calculate the gradient of the loss function with respect to the graph neural network parameters using backpropagation based on the automatic differentiation mechanism. Specifically, when calculating the gradient using backpropagation based on the automatic differentiation mechanism, the joint loss function is adjusted relative to the graph neural network parameters using the automatic differentiation mechanism. With river section Manning coefficient inversion value Guideable, river section Manning coefficient inversion value The parameter mapping is accomplished using a graph neural network, expressed as: ; in, For Let G be the graph neural network mapping function with learnable parameters, G be the river network topology graph structure, X be the set of node features, A be the set of edge features, and B be the set of boundary conditions and observation information. By constructing the gradient propagation relationship using the chain rule, accurate gradient calculation in S54 is achieved. The gradient propagation formula is as follows: ; in, This is the joint total loss function defined in S4, which includes multi-dimensional physical constraints. The solution is obtained automatically through backpropagation by a differentiable hydrodynamic solver, avoiding the repeated trial and error operations of traditional optimization methods and ensuring the efficient updating of the S55 gradient-type optimization algorithm. S55. Update the graph neural network parameters using a gradient-based optimization algorithm; S56. Repeat steps S51 to S55 until the loss function converges or the preset number of iterations is reached, and output the final river network distributed Manning coefficient inversion results. In actual training, training batches can be divided according to time windows, such as 12 hours or 24 hours per window, and the learning rate can be set to a specific value. to The number of iteration rounds can be set from 300 to 2000 to improve training efficiency and inversion accuracy.
[0047] After training converges, the inversion Manning coefficient vector for each river segment is output: In addition to outputting the Manning coefficient results for all river sections of the target river network, In addition, it synchronously outputs the hydrodynamic state variables of the entire river network calculated based on the inversion results, including water level processes. Flow process and flow rate process ,and ,in, It is an ordered sequence of Manning coefficient values corresponding to each river segment within the river network. Figure 6 The diagram illustrates the comparison between the reference Manning coefficient and the inverted Manning coefficient for each river segment. Figure 7 The illustration shows a comparison of the fitting results for water level and flow rate using the method of this invention with traditional manual zoning calibration methods and genetic algorithm calibration methods.
[0048] Therefore, this invention employs the aforementioned physically constrained differentiable graph neural network-based distributed Manning coefficient inversion method for river networks. This method deeply integrates the spatial feature mining capabilities of graph neural networks with the physical constraints of river network hydrodynamics, effectively solving technical problems in traditional Manning coefficient inversion such as cumbersome black-box optimization calculations, poor physical consistency, unreasonable spatial distribution, and insufficient boundary adaptability. Through the synergistic effect of a differentiable hydrodynamic solver and an automatic differentiation mechanism, it achieves accurate and efficient inversion of distributed Manning coefficients for river networks. Simultaneously, it outputs hydrodynamic state variables such as water level, flow rate, and velocity across the entire river network, balancing inversion accuracy and physical rationality. This provides scientific and reliable technical support and data basis for river network hydrological simulation, water resource optimization and regulation, flood control and disaster reduction, and river ecological protection.
[0049] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A physically constrained method for inverting Manning coefficients in a distributed network of differentiable graph neural networks for river networks, characterized by the following steps: include: S1. Obtain basic river network data, organize the basic river network data into river network topology information and construct the river network graph structure, and extract node features, edge features and boundary spatiotemporal sequences; S2. Based on river network topology information, node characteristics, edge characteristics and boundary spatiotemporal sequences, a graph neural network is used to output the Manning coefficient inversion value for each river segment; S3. Construct a differentiable river network hydrodynamic control model, substitute the Manning coefficient inversion value into the differentiable river network hydrodynamic control model, and simulate the river network hydrodynamic process. S4. Construct a joint loss function that includes physical constraints and calculate the total loss value; S5. Based on the automatic differentiation mechanism, end-to-end gradient optimization is performed with the goal of minimizing the joint loss function, and the results of the distributed Manning coefficient inversion of the river network are output.
2. The physically constrained differentiable graph neural network river network distributed Manning coefficient inversion method according to claim 1, characterized in that, S1 specifically includes: S11. Obtain basic river network data, including river network geographic information, water system topology, river channel cross-sectional parameters, riverbed slope, boundary conditions, and observation data; The target river network is represented as a graph structure consisting of nodes and river segments, where nodes represent boundary sections, confluence points and monitoring points, and river segments represent hydraulic connectivity. The graph structure is represented as a directed graph, and the formula is: ; in, A directed graph representing the topology of the target river network. This is a set of nodes used to represent river cross-section nodes, boundary nodes, intersection nodes, and control nodes in a river network. This is a set of edges used to represent river segments and their upstream and downstream connectivity; S12, for nodes Assigning node features For each side Assigning edge features ,in, , ; Node characteristics include: node type, boundary type, measured water level, measured flow rate, water surface width, bottom elevation, geographic coordinates, and hydrological time series state quantities; Edge features include: river segment length, riverbed slope, cross-sectional area function, wetted perimeter function, river width function, riverbed material type, vegetation cover information, and roughness prior value; S13, For any river segment Establish the correspondence between cross-sectional parameters and water surface elevation using the following formula: ; ; ; in, The cross-sectional area of the water passage. For wet period, For hydraulic radius, This refers to the water surface elevation. The geometric relationship of the river section cross-section is given by the measured cross-section, standard cross-section parameters, interpolation function or cross-section parameterization model; S14. Extract the water level and flow time series data of each inlet and outlet boundary section from the boundary conditions of the river network basic data to form the boundary spatiotemporal sequence.
3. The physically constrained differentiable graph neural network river network distributed Manning coefficient inversion method according to claim 1, characterized in that, S2 specifically includes: The river network topology information, node features, edge features, and spatiotemporal sequences of hydrological boundaries are input into a graph neural network. Through a multi-layer message passing mechanism combined with feature aggregation, the spatial correlation and upstream-downstream coupling between river segments are explored, and the Manning coefficient inversion value corresponding to each river segment is output.
4. The physically constrained differentiable graph neural network river network distributed Manning coefficient inversion method according to claim 3, characterized in that, The multi-layered message passing mechanism in S2 specifically includes: In the During the message passing process in a layered graph, the update of a node's hidden state is represented as follows: ; ; in, For nodes No. Layered aggregation messages, Represents nodes The set of adjacent nodes, Represents the message function, Represents a node In the Hidden representation of layers, Adjacent nodes In the Hidden representation of layers, For edge feature vectors, For nodes After the update Layer hidden representation, For the first Layer state update function; For the parameter inversion of the edge-level river segment, the hidden edge state is constructed using the following formula: ; in, Let e be the hidden state of the edge corresponding to river segment e. For edge feature fusion function, This represents the hidden state of the node after being passed through layer L from the upstream node. For downstream nodes The hidden state of a node after layer propagation. For river section The corresponding edge features.
5. The physically constrained differentiable graph neural network river network distributed Manning coefficient inversion method according to claim 4, characterized in that: When outputting the Manning coefficient inversion values for each river segment in S2, the Manning coefficient inversion values are constrained to a physically reasonable range using a bounded activation function. The constraint formula is as follows: ; in, For river section The Manning coefficient inversion value, and These are the lower and upper bounds of the physically reasonable range for the Manning coefficient, respectively. It is a bounded activation function. These are the weight parameters for the output layer of a graph neural network. These are the bias parameters for the output layer of the graph neural network.
6. The physically constrained differentiable graph neural network river network distributed Manning coefficient inversion method according to claim 2, characterized in that: The construction of a differentiable river network hydrodynamic control model in S3 specifically includes: A differentiable hydrodynamic solver is constructed based on the Saint-Venant equations, which include the continuity equation and the momentum equation and embed the Manning drag relation. The formula for the continuity equation is: ; in, For time, For the spatial coordinates of the river section, , For the flow rate of the river section, The lateral inflow or outflow per unit length of the river section; The momentum equation is as follows: ; in, This is the momentum correction factor. It is the acceleration due to gravity. For frictional gradient, This represents the component of the lateral incoming flow velocity in the mainstream direction; The Manning resistance relationship formula is: ; in, For river section The Manning coefficient inversion value.
7. The physically constrained differentiable graph neural network river network distributed Manning coefficient inversion method according to claim 6, characterized in that, When simulating the hydrodynamic process of the river network in S3, the coupling conditions of the river network confluence nodes, the initial simulation conditions, and the boundary conditions are set. The node coupling conditions include the flow conservation condition and the water level continuity condition. The formula for the flow conservation condition is: ; in, For inflow node The collection of river sections, outflow node The collection of river sections, This refers to the amount of water added or taken out at the node over time. For river section length, For a moment reach Downstream traffic Let t be the flow rate at the upstream end of river segment e at time t; Under conditions of no local energy loss, the water level continuity condition is met at the confluence node: ; in, Indicates the location where the river section connects to the node. For a moment Corresponding node At the water level, , For a moment Connecting nodes Water levels at the junctions of different river sections; When considering local flow losses, the energy continuity relation with local loss terms is used: ; in, The local loss coefficient of the node. For node features, water flow area For nodes Total flow at the location and They are time points Inflow and outflow nodes The water level at the junction of any section of the river; The simulation operation involves setting up initial and boundary conditions, specifically as follows: Set initial conditions for each river segment: ; ; in, and Let $x$ be the flow rate and water level of river segment $e$ at location $x$ at the initial moment. and Let be the initial flow rate and initial water level distribution functions for river segment e, respectively; The upstream boundary adopts a given flow boundary: ; in, For a moment reach Upstream inflow; The downstream boundary adopts a given water level boundary: ; in, For a moment reach Downstream water level, For a moment reach The downstream outflow water level; For general boundary conditions, a unified form is adopted: ; in, This is a boundary control function, adaptable to water level boundaries, flow boundaries, water level-flow relationship boundaries, or dam scheduling boundaries. For a moment reach The boundary control function values corresponding to the flow rate and water level.
8. The physically constrained differentiable graph neural network river network distributed Manning coefficient inversion method according to claim 1, characterized in that, The joint loss function containing physical constraints is constructed in S4 as follows: By combining the river network hydrodynamic simulation results of S3 with the observation data of S1, a joint loss function is constructed; Joint loss function The expression is: ; in, These are the weighting coefficients for each loss term. This is the observation fitting term, used to fit simulated values to observed data. These are continuity constraint terms used to constrain errors in the hydrodynamic continuity equations. This is a momentum constraint term used to constrain errors in the hydrodynamic momentum equations. These are the node intersection constraints, used to ensure that the river network intersection nodes satisfy the relationships of flow conservation and water level continuity. This is a boundary consistency term used to ensure that the hydrological conditions at the river network inlet and outlet boundaries are consistent with the actual operating conditions. This is a spatial smoothing constraint term used to constrain the spatial distribution continuity of the Manning coefficient between adjacent river segments. This is a rough a priori regularization term used to constrain the reasonableness of the Manning coefficient values.
9. The physically constrained differentiable graph neural network river network distributed Manning coefficient inversion method according to claim 1, characterized in that: The end-to-end gradient optimization in S5 includes an iterative update process, the steps of which are as follows: S51. The graph neural network is forward propagated to output the Manning coefficient inversion value for each river segment; S52. Substitute the Manning coefficient inversion value into the differentiable river network hydrodynamic control model constructed in S3 to calculate the time series water level and flow simulation values; S53. Substitute the simulated values and observed data into the joint loss function constructed in S4 to calculate the total loss value; S54. Based on the automatic differentiation mechanism, backpropagate to calculate the gradient of the loss function with respect to the parameters of the graph neural network; S55. Update the graph neural network parameters using a gradient-based optimization algorithm; S56. Repeat steps S51 to S55 until the loss function converges or the preset number of iterations is reached, and output the final river network distributed Manning coefficient inversion result.
10. The physically constrained differentiable graphical neural network river network distributed Manning coefficient inversion method according to claim 9, characterized in that: In S54, when calculating the gradient through backpropagation based on the automatic differentiation mechanism, the joint loss function is made relative to the graph neural network parameters by relying on the automatic differentiation mechanism. With river section Manning coefficient inversion value Guideable, river section Manning coefficient inversion value The parameter mapping is accomplished using a graph neural network, expressed as: ; in, For graph neural network parameters For graph neural network mapping functions with learnable parameters, This is a diagram of the river network topology. For the set of node features, For the set of edge features, It is a set of boundary conditions and observation information; By constructing the gradient propagation relationship using the chain rule, accurate gradient calculation in S54 is achieved. The gradient propagation formula is as follows: ; in, This is the joint total loss function defined in S4, which includes multi-dimensional physical constraints. The solution is obtained automatically through backpropagation by a differentiable hydrodynamic solver, avoiding the repeated trial and error operations of traditional optimization methods and ensuring the efficient updating of the S55 gradient-type optimization algorithm. After the loss function in S56 meets the convergence condition or reaches the preset number of iterations, the Manning coefficient results for all river segments of the target river network are output. In addition, it synchronously outputs the hydrodynamic state variables of the entire river network calculated based on the inversion results, including water level processes. Flow process and flow rate process ,and ,in, It is an ordered sequence of Manning coefficient values corresponding to each river segment within the river network.