Hydraulic model construction and optimization method based on fluid mechanics and AI algorithm

By introducing attention mechanism and dynamic optimization mechanism into the hydraulic model and combining simulated annealing algorithm for global optimization, the shortcomings of traditional hydraulic model construction methods in response to dynamic changes in water flow and parameter optimization are solved, and more efficient and accurate hydraulic model construction and optimization are achieved.

CN119885958AInactive Publication Date: 2025-04-25XUZHOU COLLEGE OF INDAL TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411977637.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional hydraulic model construction methods lack the ability to dynamically adjust the model structure, it is difficult to respond to dynamic changes in water flow, and local search algorithms are difficult to ensure that model parameters converge to the global optimal solution.

Method used

Using a method based on fluid mechanics and AI algorithms, a hydraulic model of adaptive topological structure is constructed by introducing attention mechanisms and dynamic optimization mechanisms, and a simulated annealing algorithm is used for global optimization.

Benefits of technology

The prediction accuracy and adaptability of the hydraulic model are improved, ensuring that the model can dynamically respond to water flow changes, and optimizing model parameters to improve performance, providing safe and efficient operation guarantees for water conservancy projects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119885958A_ABST
    Figure CN119885958A_ABST
Patent Text Reader

Abstract

The invention discloses a hydraulic model construction and optimization method based on fluid mechanics and an AI algorithm, and relates to the technical field of hydraulic models, and the system comprises the following components: S1, model prediction based on an attention mechanism, S2, hydraulic model construction of a self-adaptive topological structure, and S3, simulated annealing algorithm auxiliary model global optimization. According to the method, dynamic adjustment of a model structure and optimal configuration of parameters are achieved through hydraulic model construction of the self-adaptive topological structure and simulated annealing algorithm-assisted global optimization, the self-adaptive topological structure can automatically increase nodes and connections according to the change of the water flow state, the response capability of the model to the dynamic change of the water flow is improved, and meanwhile, the dynamic change of the water flow is optimized. The global search capability of the simulated annealing algorithm ensures that model parameters can converge to a global optimal solution, the dynamic optimization mechanism enables the hydraulic model to better adapt to different water flow conditions and engineering requirements, and powerful guarantee is provided for safe and efficient operation of hydraulic engineering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hydraulic models, and specifically to a hydraulic model construction and optimization method based on fluid mechanics and AI algorithms. Background Art

[0002] Hydraulic models are indispensable tools in the fields of water conservancy engineering, environmental protection, and urban planning. They are used to simulate and analyze the behavior of water flow under specific conditions. With the continuous development of fluid mechanics theory and the rapid advancement of computer technology, the construction and optimization of hydraulic models have become an increasing research hotspot.

[0003] There are deficiencies in traditional technologies. Traditional hydraulic model construction methods lack the ability to dynamically adjust the model structure. Their adaptive topological structure cannot automatically add nodes and connections according to changes in water flow conditions, resulting in limited responsiveness of the model to dynamic changes in water flow. At the same time, in terms of parameter optimization, traditional methods often rely on local search algorithms, which makes it difficult to ensure that model parameters can converge to the global optimal solution, thus limiting further improvement of model performance.

[0004] In summary, traditional hydraulic model construction and global optimization methods have many shortcomings when facing complex and changeable water flow conditions. Therefore, it is particularly important to develop a hydraulic model construction and optimization method based on fluid mechanics and AI algorithms. Summary of the invention

[0005] The purpose of this invention is to make up for the shortcomings of the existing technology and provide a hydraulic model construction and optimization method based on fluid mechanics and AI algorithm. It can improve the prediction accuracy and adaptability of the hydraulic model by introducing AI algorithm and dynamic optimization mechanism, and provide strong guarantee for the safe and efficient operation of water conservancy projects.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: a hydraulic model construction and optimization method based on fluid mechanics and AI algorithm, the specific steps of the method are:

[0007] S1. Model prediction based on attention mechanism:

[0008] The collected hydraulic data, including water level data series S at different time and space locations, are w ={s w1 ,s w2 ,…,s wn}、Flow data sequence S q ={s q1 ,s q2 ,…,s qn}, flow rate data sequence S v ={s v1 ,sv2 ,…,s vn}, normalize it and map it to the interval [0, 1] to obtain the normalized data sequence S′ w ={s′ w ,s′ w2 ,…,s′ wm}、S′ q ={s′ q1 ,s′ q2 ,…,s′ qn}、S′ v ={s′ v1 ,s′ v2 ,…,s′ vn}, the normalized formula is Where i represents the data type, w represents the water level, q represents the flow, v represents the flow velocity, and j represents the time or space index of the data. A deep neural network architecture is adopted, which combines the advantages of convolutional neural network (CNN) and recurrent neural network (RNN). First, a set of convolution kernels K = {k1, k2, ..., k m}Convolution operation is performed on the normalized data. The convolution formula is: Among them C ij is the feature value after convolution, P and Q are the width and height of the convolution kernel respectively, m is the number of convolution kernels, and then the convolution feature is input into the RNN unit, which has an adaptive forget gate mechanism. The forget gate formula is f t =σ(W f ·[h t-1 ,C t-1 ]+b f ), where f t is the forget gate value at time t, σ is the sigmoid function, W f is the weight matrix of the forget gate, [h t-1 ,C t-1 ] is the concatenation of the hidden state and convolutional features of the previous moment, b f is the bias term. In this way, a more representative feature vector H = {h1,h2,…,h n};

[0009] The attention mechanism is introduced, which assigns weights by calculating the similarity between feature vectors. First, the feature vector h is calculated. i and h j The similarity score between where d h is the dimension of the feature vector, and then calculate the weight of each feature vector Finally, the weighted feature vectors are summed to obtain the attention output This is used as the basis for model prediction;

[0010] S2. Construction of Hydraulic Model with Adaptive Topology Structure:

[0011] Arrange multiple sensors in the water flow system to collect water flow state data in real time, and at the same time obtain boundary condition data. Preprocess the collected data to remove noise and outliers. Use the Kalman filter algorithm to process the water level data S w for denoising. Its state equation is The observation equation is where x t is the state vector at time t, A is the state transition matrix, B is the control input matrix, u t-1 is the control input at time t - 1, w t-1 is the process noise, y t is the observed value at time t, H is the observation matrix, v t is the observation noise. Obtain the denoised water level data through the Kalman filter algorithm Use machine learning algorithms to analyze the preprocessed data to identify areas where the water flow changes violently or there are complex flow phenomena. Specifically, use the density peak clustering method. First, calculate the local density of each data point where d ij is the distance between data points i and j, d c is the truncation distance, and then calculate the distance of each data point According to the local density and distance, determine the clustering center, so as to identify the areas where the topological structure needs to be adjusted;

[0012] In the identified areas, automatically add nodes and connections according to the physical characteristics and actual needs of the water flow. For the positions where nodes need to be added, determine them according to the velocity gradient and pressure distribution of the water flow. Assume that the velocity vector at a certain position is the pressure is p, and the velocity gradient is calculated by the finite difference method. If and |p - p0| > τ2, where τ1 and τ2 are preset thresholds and p0 is the reference pressure, then add a node at this position. For the establishment of connections, determine them according to the water flow direction and distance between nodes. If the distance d between two nodes is < d0, where d0 is the preset connection distance threshold, and the water flow direction points to the target node, then establish a connection;

[0013] S3. Global Optimization of the Model Assisted by Simulated Annealing Algorithm:

[0014] Encode the parameters and structure of the hydraulic model to form a solution vector X = {x1, x2, …, x m}, where x irepresents a parameter or structural information of the model, x1 can be the friction coefficient, x2 can be the number of nodes, set the initial parameters of the simulated annealing algorithm, including the initial temperature T0, the cooling rate α (0<α<1), the maximum number of iterations N, randomly generate an initial solution vector X0, and calculate its objective function value f(X0). The objective function uses the mean square error between the model prediction value and the actual observation value. The formula is where y pi is the model prediction value, y oi is the actual observed value. In each iteration, the current solution vector X t Perform random perturbations to generate a new solution vector X t+1 , the disturbance mode is X t+1 =X t +□·ΔX, where □ is a random number and ΔX is a perturbation vector. Calculate the objective function value f(X t+1 ), and compared with the objective function value f(X t ) is compared, if f(X t+1 ) <f(X t ), then directly accept the new solution as the current optimal solution. If f(X t+1 )≥f(X t ), then according to the Metropolis criterion, the probability Accept the new solution, where T t is the current temperature, according to the cooling strategy T t+1 =αT t Lower the temperature;

[0015] When the number of iterations reaches the maximum number of iterations N or the objective function value converges to a certain extent, the optimization process is terminated, and the model parameters and structures corresponding to the global optimal solution are applied to the hydraulic model to complete the optimization of the model.

[0016] Furthermore, in the model prediction based on the attention mechanism, the parameters of the convolution kernel K are optimized by a genetic algorithm. The genetic algorithm first randomly generates a set of initial convolution kernel parameters and uses them as the initial population. In each generation, the fitness of each individual is evaluated. The fitness function is F where f err (K) is the error of model prediction after feature extraction using the convolution kernel parameters. Then, a new population is generated through selection, crossover and mutation operations. The selection operation adopts the roulette wheel selection method and the selection probability is calculated according to the fitness of the individual. Where N p is the population size. The crossover operation uses a single-point crossover. A crossover point is randomly selected between the two parent individuals. The gene fragments after the crossover point are exchanged. The mutation operation is performed with a certain mutation probability P. mThe genes of individuals are randomly changed, and the optimal convolution kernel parameters are obtained through multiple generations of evolution. This allows the convolution kernel to better extract features from hydraulic data and improve the performance of the model.

[0017] Furthermore, in the model prediction based on the attention mechanism, the weight matrix W of the adaptive forget gate mechanism in the RNN unit is f and the bias term b f The training is performed through an optimization algorithm based on gradient descent. During the training process, the prediction error E of the model is used as the loss function, and the gradient is calculated through the back propagation algorithm. For the weight matrix W f Gradient calculation, first calculate the hidden state h t To W f The partial derivative of Then calculate the loss function E versus W according to the chain rule f Gradient For the bias term b f The gradient calculation is similar to that of Then according to the gradient descent formula and Update the weight matrix and bias term, where k is the number of iterations and η is the learning rate. By continuously adjusting the weight matrix and bias term, the model can better process time series data and improve the accuracy of prediction.

[0018] Furthermore, in the construction of the hydraulic model of the adaptive topology structure, the state transfer matrix A, the control input matrix B, the observation matrix H, the process noise covariance Q and the observation noise covariance R in the Kalman filter algorithm are determined according to the physical characteristics of the water flow system and historical data. According to the motion equation and dynamic principle of the water flow, a state space model is established to determine the theoretical form of the state transfer matrix A and the control input matrix B. The historical data are used for parameter estimation, and the maximum likelihood estimation method is used to maximize the likelihood function of the observed data. To determine the values ​​of these parameters, p(y t |A,B,H,Q,R) is the observed value y under given parameters t The probability density function of the water flow system can better adapt to the actual situation of the water flow system, improve the denoising effect of the Kalman filter algorithm on the data, and provide a more accurate data basis for subsequent area identification and topological structure adjustment.

[0019] Furthermore, in the construction of the hydraulic model of the adaptive topological structure, in the region identification method based on density peak clustering, the cutoff distance d c The determination adopts an adaptive method to calculate the distance matrix D between all data points = {dij}, then sort the distance matrix to get the distance sequence from small to large, and select the distance value of a position in the distance sequence as the cutoff distance d c , so that different clustering areas can be divided under this cutoff distance. Specifically, the cumulative distribution function CDF(d) of the distance sequence is calculated, and the distance value corresponding to when CDF(d) reaches the preset ratio is selected as d c , so that the cutoff distance can be automatically adjusted according to the distribution of the data, the accuracy of clustering can be improved, so as to more accurately identify areas with drastic water flow changes or complex flow phenomena, and provide a more reliable basis for the adjustment of the topological structure.

[0020] Furthermore, in the construction of the hydraulic model of the adaptive topology structure, when determining the location where the node needs to be added, the turbulence intensity of the water flow is also considered. The turbulence intensity of the water flow is measured by calculating the turbulent kinetic energy k. The calculation formula of the turbulent kinetic energy k is: in are the mean square values ​​of the pulsating velocities in the three directions respectively. If And |p-p0|>τ2 and k>τ3, τ3 is the preset turbulence intensity threshold, then a node is added at this position. By comprehensively considering multiple factors, the complexity of the water flow can be more comprehensively evaluated, and nodes can be added at more appropriate locations to further improve the resolution of the model and its ability to simulate complex water flows.

[0021] Furthermore, in the simulated annealing algorithm-assisted model global optimization, the random perturbation vector ΔX is generated using a normal distribution method. Specifically, for each element x in the solution vector X, i , whose disturbance value Δx i The mean is 0 and the standard deviation is σ i The normal distribution of Standard deviation i According to the parameter x i The value range and importance of are adjusted. For parameters with a large value range and a greater impact on model performance, their standard deviation is increased to ensure that the solution space can be searched more widely during the disturbance process. For parameters with a small value range and a relatively small impact on model performance, their standard deviation is appropriately reduced to ensure that the parameter value does not deviate too much from the reasonable range during the disturbance process. The random perturbation vector generated in this way can better balance the global search and local search capabilities while ensuring the search efficiency, thereby increasing the probability of the simulated annealing algorithm finding the global optimal solution.

[0022] Furthermore, in the simulated annealing algorithm-assisted model global optimization, the cooling strategy also introduces a mechanism for adaptively adjusting the cooling rate α. During the iteration process, the rate of change of the objective function value in several adjacent iterations is calculated. Where k is a preset window of iteration times. If Δf<τ4, τ4 is the preset threshold of the rate of change of the objective function, it means that the convergence speed of the objective function value is slow. At this time, the cooling rate α is appropriately reduced to increase the probability of accepting a worse solution and expand the search range. If Δf>τ5 is another preset threshold of the rate of change of the objective function, and τ5>τ4, it means that the objective function value drops too fast and some potential better solutions are missed. At this time, the cooling rate α is appropriately increased to speed up the cooling process so that the algorithm converges to a relatively good solution faster. Specifically, when Δf<τ4, let α=α×(1-β1), and when Δf>τ5, let α=α×(1+β2), where β1 and β2 are pre-set adjustment coefficients, and 0<β1, β2<1. This adjustment is not made arbitrarily, but is based on a precise analysis of the trend of changes in the objective function value during the model optimization process.

[0023] Compared with the existing technology, this hydraulic model construction and optimization method based on fluid mechanics and AI algorithm has the following beneficial effects:

[0024] 1. This method realizes the dynamic adjustment of the model structure and the optimal configuration of parameters through the construction of a hydraulic model with an adaptive topology structure and global optimization assisted by a simulated annealing algorithm. The adaptive topology structure can automatically add nodes and connections according to changes in water flow conditions, thereby improving the model's ability to respond to dynamic changes in water flow. At the same time, the global search capability of the simulated annealing algorithm ensures that the model parameters can converge to the global optimal solution, further improving the performance of the model. This dynamic optimization mechanism enables the hydraulic model to better adapt to different water flow conditions and engineering requirements, providing a strong guarantee for the safe and efficient operation of water conservancy projects.

[0025] 2. This method combines fluid mechanics with AI algorithms to achieve accurate construction and optimization of hydraulic models. By using deep neural network architecture and attention mechanism, this method can efficiently process and analyze large amounts of hydraulic data, thereby improving the accuracy and reliability of model predictions. This combination not only optimizes the data processing process, but also enhances the model's ability to simulate complex hydraulic phenomena, providing a more scientific basis for the planning, design and management of water conservancy projects.

[0026] Other advantages, objectives and features of the present invention will be set forth in part in the following description and, in part, will be apparent to those skilled in the art based on an examination of the following or may be taught from the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0028] Figure 1 This is a process operation diagram of a hydraulic model construction and optimization method based on fluid mechanics and AI algorithm. DETAILED DESCRIPTION

[0029] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation mode, structure, characteristics and effects of the present invention are described in detail below in combination with the accompanying drawings and preferred embodiments.

[0030] Embodiment 1

[0031] This embodiment describes that the urban water supply system includes multiple water sources, pumping stations, water pipelines and user areas. The water flow conditions are complex and changeable. In order to achieve efficient water supply scheduling and ensure water supply safety, it is necessary to build an accurate hydraulic model.

[0032] Sensors are placed at key nodes of the water supply system (such as water sources, pump station outlets, and large user access points) to collect water level, flow, and flow velocity data at different times. For example, data is collected every 15 minutes for one week to obtain a water level data sequence S. w ={s w1 ,s w2 ,…,s wn}、Flow data sequence S q ={s q1 ,s q2 ,…,s qn} and flow rate data sequence S v ={s v1 ,s v2 ,…,s vm}(n is the number of times data is collected), using the formula Normalize the data and map it to the interval [0, 1] to obtain the normalized data sequence S′ w , S′ q and S′ v , Feature extraction and attention mechanism: Using a deep neural network architecture, through a set of convolution kernels K = {k1, k2, ..., k m}Convolution operation is performed on the normalized data. The convolution formula is: Among them, the width P and height Q of the convolution kernel are set according to data characteristics and experience (e.g., P = 3, Q = 3), the number m of convolution kernels is 8, and then the convolved features are input into an RNN unit with an adaptive forgetting gate mechanism. The forgetting gate formula is f t = σ(W f ·[h t-1 , C t-1 +b f ), and the feature vector H = {h1, h2, …, h n} is extracted. Then, an attention mechanism is introduced to calculate the similarity score between the feature vectors h i and h j and then calculate the weight of each feature vector Finally, the attention output

[0033] The sensor continuously collects water level data S w , and the Kalman filtering algorithm is used for denoising. The state equation is x t = Ax t-1 + Bu t-1 + w t-1 , and the observation equation is y t = Hx t + v t , where the state transition matrix A, the control input matrix B, the observation matrix H, and the process noise covariance Q and the observation noise covariance R are determined by the physical characteristics of the water flow system (such as pipe roughness, water viscosity) and historical data using the maximum likelihood estimation method. The machine learning algorithm (density peak clustering) is used to analyze the preprocessed data, and the local density of each data point is calculated (the truncation distance d c is determined by an adaptive method. By calculating the cumulative distribution function CDF(d) of the distance sequence, the distance value corresponding to when CDF(d) reaches a preset ratio is selected as d c ), and then the distance of each data point is calculated The clustering center is determined to identify the areas where the water flow changes violently or there are complex flow phenomena, and the topological structure is adjusted. In the identified areas, the positions for adding nodes are determined according to the water flow velocity gradient (calculated by the finite difference method) and the pressure distribution. For example, when the velocity gradient and the pressure difference |p - p0| > τ2 (τ2 = 0.3), adding nodes is considered. At the same time, the turbulence intensity of the water flow is also considered. If the turbulent kinetic energy then a node is added at this position. For the establishment of connections, if the distance d between two nodes is < d0 (d0 = 100 meters) and the water flow direction points to the target node, a connection is established.

[0034] The parameters of the hydraulic model (such as pipeline friction coefficient, node flow coefficient) and structural information (such as number of nodes, connection method) are encoded to form a solution vector X = {x1, x2, ..., x m}, set the initial parameters of the simulated annealing algorithm, initial temperature T0 = 100, cooling rate α = 0.95, maximum number of iterations N = 1000, randomly generate the initial solution vector X0, and calculate its objective function value (y pi is the model prediction value, y o i is the actual observed value), and in each iteration, a new solution vector X is generated by random perturbation t+1 =X t +∈·ΔX, the perturbation vector ΔX is generated using the normal distribution method. For each element x in the solution vector i , whose disturbance value Δx i The mean is 0 and the standard deviation is σ i The normal distribution (σ i According to the parameter value range and importance adjustment), calculate the objective function value f(X t+1 ), compared with the objective function value of the current solution, if f(X t+1 ) <f(X t ), accept the new solution, if f(X t+1 )≥f(X t ), according to the Metropolis criterion, with probability Accept the new solution. At the same time, the cooling strategy introduces an adaptive adjustment mechanism to calculate the rate of change of the objective function value in several consecutive iterations. When Δf<τ4 (τ4=0.01), let α=α×(1-β1)(β1=0.05); when Δf>τ5 (τ5=0.1), let α=α×(1+β2)(β2=0.05). When the number of iterations reaches N or the objective function value converges to a certain extent, the optimization process is terminated and the optimal solution is applied to the hydraulic model.

[0035] Embodiment 2

[0036] This embodiment describes a large-scale irrigation channel system, which is used to provide irrigation water for surrounding farmland. The channel is long and the water flow is greatly affected by the terrain and crop water demand. Multiple monitoring points are set along the channel to monitor water level and flow data. At the same time, the channel has multiple water inlets and outlets, and the boundary conditions are complex.

[0037] The water level, flow rate and velocity data sequences were collected at different spatial locations (different monitoring points along the channel). For example, monitoring points were set up in the upstream, midstream and downstream of the channel, and relevant data were collected in different seasons and irrigation periods.

[0038] Perform data normalization, taking traffic data as an example, and use the normalization formula for mapping.

[0039] The deep neural network architecture is used for convolution operation. Assuming that 5 convolution kernels are used and the convolution kernel size is 2x2, the flow data is convolved to obtain the convolved features.

[0040] The features are input into the RNN unit, processed by the adaptive forget gate mechanism, the forget gate value is calculated, and the hidden state is updated.

[0041] The attention mechanism is introduced to calculate the feature vector similarity score and weight to obtain the attention output, which is used to predict the changing trend of water flow state in each section of the channel.

[0042] The channel flow data and boundary condition data are collected in real time, and the water level data are denoised by the Kalman filter algorithm to determine the correlation matrix and noise covariance parameters.

[0043] Density peak clustering is used to identify special areas of water flow changes in the channel, calculate the local density and distance of data points, determine the cluster center, and the cutoff distance is adaptively determined according to the data distribution, such as the distance value when the cumulative distribution function reaches 0.7.

[0044] Add nodes in areas with large water velocity gradients and obvious pressure changes, such as at channel bends or branches. Calculate based on velocity vector, pressure and velocity gradient. If the conditions are met, add nodes, establish connections based on water flow direction and distance between nodes, and optimize the channel network topology.

[0045] The hydraulic model parameters and structure are encoded as the solution vector, and the simulated annealing algorithm parameters are set, such as initial temperature T0=80, cooling rate α=0.9, and maximum number of iterations N=800.

[0046] Generate an initial solution vector and calculate the objective function value, taking the mean square error between the predicted channel flow and the actual measured flow as the objective function.

[0047] During the iteration process, random perturbations are used to generate new solution vectors, the objective function values ​​of the new solutions are calculated, the new solutions are accepted according to the Metropolis criterion, the temperature is lowered according to the cooling strategy, and the cooling rate is adaptively adjusted according to the rate of change of the objective function value. When the termination condition is reached, the optimal model parameters and structure are determined and applied.

[0048] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A hydraulic model construction and optimization method based on fluid mechanics and AI algorithm, characterized in that: The specific steps of this method are: S1. Model prediction based on attention mechanism: The collected hydraulic data, including water level data series S at different time and space locations, are w ={s w1 ,s w2 ,…,s wn }、Flow data sequence S q ={s q1 ,s q2 ,…,s qn }, flow rate data sequence S v ={s v1 ,s v2 ,…,s vn }, normalize it and map it to the interval [0, 1] to obtain the normalized data sequence S′ w ={s′ w ,s′ w2 ,…,s′ wm }、S′ q ={s′ q1 ,s′ q2 ,…,s′ qn }、S′ v ={s′ v1 ,s′ v2 ,…,s′ vn }, the normalized formula is Where i represents the data type, w represents the water level, q represents the flow, v represents the flow velocity, and j represents the time or space index of the data. A deep neural network architecture is adopted, which combines the advantages of convolutional neural network (CNN) and recurrent neural network (RNN). First, a set of convolution kernels K = {k1, k2, ..., k m }Convolution operation is performed on the normalized data. The convolution formula is: Among them C ij is the feature value after convolution, P and Q are the width and height of the convolution kernel respectively, m is the number of convolution kernels, and then the convolution feature is input into the RNN unit, which has an adaptive forget gate mechanism. The forget gate formula is f t =σ(W f ·[h t-1 ,C t-1 ]+b f ), where f t is the forget gate value at time t, σ is the sigmoid function, W f is the weight matrix of the forget gate, [h t-1 ,C t-1 ] is the concatenation of the hidden state and convolutional features of the previous moment, b f is the bias term. In this way, a more representative feature vector H = {h1,h2,…,h n }; The attention mechanism is introduced, which assigns weights by calculating the similarity between feature vectors. First, the feature vector h is calculated. i and h j The similarity score between where d h is the dimension of the feature vector, and then calculate the weight of each feature vector Finally, the weighted feature vectors are summed to obtain the attention output This is used as the basis for model prediction; S2. Construction of hydraulic model with adaptive topology: Arrange multiple sensors in the water flow system to collect water flow status data in real time and obtain boundary condition data at the same time. Preprocess the collected data to remove noise and outliers. Use Kalman filtering algorithm to filter the water level data S w After denoising, the state equation is: The observation equation is where x t is the state vector at time t, A is the state transfer matrix, B is the control input matrix, u t-1 is the control input at time t-1, w t-1 is the process noise, y t is the observation value at time t, H is the observation matrix, v t is the observation noise, and the denoised water level data is obtained through the Kalman filter algorithm The preprocessed data is analyzed using a machine learning algorithm to identify areas where water flow changes dramatically or complex flow phenomena exist. Specifically, the density peak clustering method is used to first calculate the local density of each data point. where d ij is the distance between data points i and j, d c is the cutoff distance, and then calculate the distance of each data point Based on local density and distance, cluster centers are determined to identify areas where topology needs to be adjusted; Within the identified area, nodes and connections are automatically added according to the physical characteristics of the water flow and actual requirements. For the positions where nodes need to be added, they are determined based on the velocity gradient and pressure distribution of the water flow. Assume that the velocity vector at a certain position is the pressure is p, and the velocity gradient is calculated by the finite difference method. If and |p - p0| > τ2, where τ1 and τ2 are preset thresholds and p0 is the reference pressure, then a node is added at this position. For the establishment of connections, they are determined according to the water flow direction and distance between nodes. If the distance d between two nodes is < d0, where d0 is the preset connection distance threshold, and the water flow direction points to the target node, then a connection is established; S3, simulated annealing algorithm assisted model global optimization: The parameters and structure of the hydraulic model are encoded to form a solution vector X = {x1, x2, ..., x m }, where x i represents a parameter or structural information of the model, x1 can be the friction coefficient, x2 can be the number of nodes, and the initial parameters of the simulated annealing algorithm are set, including the initial temperature T0, the cooling rate α (0<α<1), and the maximum number of iterations N. An initial solution vector X0 is randomly generated, and its objective function value f(X0) is calculated. The objective function uses the mean square error between the model prediction value and the actual observation value. The formula is where y pi is the model prediction value, y oi is the actual observed value. In each iteration, the current solution vector X t Perform random perturbations to generate a new solution vector X t+1 , the disturbance mode is X t+1 =X t +□·ΔX, where □ is a random number and ΔX is a perturbation vector. Calculate the objective function value f(X t+1 ), and compared with the objective function value f(X t ) is compared, if f(X t+1 ) <f(X t ), then directly accept the new solution as the current optimal solution. If f(X t+1 )≥f(X t ), then according to the Metropolis criterion, the probability Accept the new solution, where T t is the current temperature, according to the cooling strategy T t+1 =αT t Lower the temperature; When the number of iterations reaches the maximum number of iterations N or the objective function value converges to a certain extent, the optimization process is terminated, and the model parameters and structures corresponding to the global optimal solution are applied to the hydraulic model to complete the optimization of the model.

2. A hydraulic model construction and optimization method based on fluid mechanics and AI algorithm according to claim 1, characterized in that: In the model prediction based on the attention mechanism, the parameters of the convolution kernel K are optimized by a genetic algorithm. The genetic algorithm first randomly generates a set of initial convolution kernel parameters and uses them as the initial population. In each generation, the fitness of each individual is evaluated. The fitness function is where f err (K) is the error of model prediction after feature extraction using the convolution kernel parameters. Then, a new population is generated through selection, crossover and mutation operations. The selection operation adopts the roulette wheel selection method and the selection probability is calculated according to the fitness of the individual. Where N p is the population size. The crossover operation uses a single-point crossover. A crossover point is randomly selected between the two parent individuals. The gene fragments after the crossover point are exchanged. The mutation operation is performed with a certain mutation probability P. m The genes of individuals are randomly changed, and the optimal convolution kernel parameters are obtained through multiple generations of evolution.

3. The method for constructing and optimizing a hydraulic model based on fluid mechanics and AI algorithm according to claim 1, characterized in that: In the model prediction based on the attention mechanism, the weight matrix W of the adaptive forget gate mechanism in the RNN unit is f and the bias term b f The training is performed through an optimization algorithm based on gradient descent. During the training process, the prediction error E of the model is used as the loss function, and the gradient is calculated through the back propagation algorithm. For the weight matrix W f Gradient calculation, first calculate the hidden state h t To W f The partial derivative of Then calculate the loss function E versus W according to the chain rule f Gradient For the bias term b f The gradient calculation is similar to that of Then according to the gradient descent formula Update the weight matrix and bias term, where k is the number of iterations and η is the learning rate.

4. The method for constructing and optimizing a hydraulic model based on fluid mechanics and AI algorithm according to claim 1, characterized in that: In the construction of the hydraulic model of the adaptive topology structure, the state transfer matrix A, the control input matrix B, the observation matrix H, the process noise covariance Q and the observation noise covariance R in the Kalman filter algorithm are determined according to the physical characteristics of the water flow system and historical data. According to the motion equation and dynamic principle of the water flow, a state space model is established to determine the theoretical form of the state transfer matrix A and the control input matrix B. The historical data are used for parameter estimation, and the maximum likelihood estimation method is used to maximize the likelihood function of the observed data. To determine the values ​​of these parameters, p(y t |A,B,H,Q,R) is the observed value y under given parameters t The probability density function of .

5. The method for constructing and optimizing a hydraulic model based on fluid mechanics and AI algorithm according to claim 1, characterized in that: In the construction of the hydraulic model of the adaptive topological structure, in the region identification method based on density peak clustering, the cutoff distance d c The determination adopts an adaptive method to calculate the distance matrix D between all data points = {d ij }, then sort the distance matrix to get the distance sequence from small to large, and select the distance value of a position in the distance sequence as the cutoff distance d c , so that different clustering areas can be divided under this cutoff distance. Specifically, the cumulative distribution function CDF(d) of the distance sequence is calculated, and the distance value corresponding to when CDF(d) reaches the preset ratio is selected as d c .

6. The method for constructing and optimizing a hydraulic model based on fluid mechanics and AI algorithm according to claim 1, characterized in that: In the construction of the hydraulic model of the adaptive topology structure, when determining the location where the node needs to be added, the turbulence intensity of the water flow is also considered. The turbulence intensity of the water flow is measured by calculating the turbulent kinetic energy k. The calculation formula of the turbulent kinetic energy k is: in are the mean square values ​​of the pulsating velocities in the three directions respectively. If If |p-p0|>τ2 and k>τ3, where τ3 is the preset turbulence intensity threshold, a node is added at this position.

7. The method for constructing and optimizing a hydraulic model based on fluid mechanics and AI algorithm according to claim 1, characterized in that: In the simulated annealing algorithm-assisted model global optimization, the random perturbation vector ΔX is generated using a normal distribution method. Specifically, for each element x in the solution vector X i , whose disturbance value Δx i The mean is 0 and the standard deviation is σ i The normal distribution of Standard deviation i According to the parameter x i The value range and importance of the parameters are adjusted. For parameters with a large value range and a greater impact on model performance, their standard deviation is increased. For parameters with a small value range and a relatively small impact on model performance, their standard deviation is appropriately reduced.

8. The method for constructing and optimizing a hydraulic model based on fluid mechanics and AI algorithm according to claim 1, characterized in that: In the simulated annealing algorithm-assisted model global optimization, the cooling strategy also introduces a mechanism for adaptively adjusting the cooling rate α. During the iteration process, the rate of change of the objective function value in several consecutive iterations is calculated. Where k is a preset window of iteration times. If Δf<τ4, τ4 is the preset threshold of the rate of change of the objective function, it means that the convergence speed of the objective function value is slow. At this time, the cooling rate α is appropriately reduced to increase the probability of accepting a worse solution and expand the search range. If Δf>τ5 is another preset threshold of the rate of change of the objective function, and τ5>τ4, it means that the objective function value drops too fast and some potential better solutions are missed. At this time, the cooling rate α is appropriately increased to speed up the cooling process so that the algorithm converges to a relatively good solution faster. Specifically, when Δf<τ4, let α=α×(1-β1), and when Δf>τ5, let α=α×(1+β2), where β1 and β2 are pre-set adjustment coefficients, and 0<β1, β2<1. This adjustment is not made arbitrarily, but is based on a precise analysis of the trend of changes in the objective function value during the model optimization process.

Citation Information

Cited By

  • Soil-rock composite stratum deep foundation pit deformation time sequence prediction method based on GA-PSO-GLSSVM algorithm

    CN121351637A

  • Time series prediction method for deformation of deep foundation pit in soil-rock composite stratum based on GA-PSO-GLSSVM algorithm

    CN121351637B